Shared
DescriptionShared <variable> [,<variable>,...]
Shared allows a variable, an array or a linkedlist to be accessed within a procedure. When Shared is used with an array or a linkedlist, only the name followed by '()' has to be specified.Example: With variable
a = 10 Procedure Change() Shared a a = 20 EndProcedure Change() Debug a ; Will print 20, as the variable has been shared.
Example: With array and linkedlist
Dim Array(2) NewList List() AddElement(List()) Procedure Change() Shared Array(), List() Array(0) = 1 List() = 2 EndProcedure Change() Debug Array(0) ; Will print 1, as the array has been shared. Debug List() ; Will print 2, as the linkedlist has been shared.