Is it a bad idea to use global objects like this?
Posted: 05 May 2017, 21:29
The script I am thinking about has about 300 strings of data in text or numbers, which need to be accessible to about 5 different hotkey programs, which all share a function but have different instructions and input to the function. The script would be running for about 8 hours at a time.
Code: Select all
global data
data:=["string of data1","string of data 2", .... "string of data n"]
some_function_that_uses_data(input)
{
; some instructions that use data and %input%
}
F1::
{
; some instructions that define %input%
some_function_that_uses_data(input)
; some other instructions that use data
return
}
F2::
{
; some instructions that define %input%
some_function_that_uses_data(input)
; some other instructions that use data
return
}