Small company logo:
   History
 
Advertising banner:
 
 LAS1
Home • Help • Customization Tools • FCAS • LAS1
 
Variables defined as SharedGlobal can be shared across all applications running on a given FCAS instance. They can be treated just as local or global variables within a program, but any program using them may change their value or even Redim or Redim Preserve them.
SharedGlobal variables can be of any type, including user-defined types. They can't be passed into Subs or Functions as they are global to the program and can be referenced at any point. SharedGlobal variables will not interfere with local or global variable naming unless they are defined in the program.
Keep in mind when using arrays that another program may redefine the dimensions of the array. Also be aware that a SharedGlobal may change value from one line to the next if another program is also changing the value. SharedGlobal variables are completely "thread safe" in that you can't cause application crashes using them, although you could introduce logic problems in your code if you fail to account for the value changing unexpectedly.
Unique names are encouraged to prevent multiple developers from using the same name and inadvertently overlapping with another program's variable name.
Examples of the use of SharedGlobal variables are:
Dim Test(2) as String SharedGlobal
Redim Test(3) as String SharedGlobal
Redim Preserve Test(4) as String SharedGlobal