MC-Basic:DIM SHARED ... AS LONG or DOUBLE or STRING or STRING OF UTF8
This command is used to define a task variable. Task variables are defined within a task, and may be used only within that task.
A variable being defined may be scalar or array. An array may be defined with up to 10 dimensions. The length of a string variable practically is not limited (limited by the amount of free memory space).
A task variable may have the same name as a system variable. Within the task, a reference to the variable name will reference the task variable and not the system variable.
The value of a task variable may be queried from the terminal using the Watch mechanism.
Dim Shared <variable> As Long | Double | String | String of UTF8
All versions. Declaration of UTF-8 strings is available since Version 4.5.10.
Write only. Task variables must be defined before the start of the task itself (before the Program keyword).
Dim Shared Var1 as long ‘Integer
Dim Shared MyArray as long ‘Long array
Program ‘Start of task
End Program ‘End of task