This feature was developed to aid the splitting of large programs into DLLs. It allows a group of global variables to be easily shared without renaming or major alterations to the original program.
Original Program:
int a=1
int b=2
int c=3
float f=1.5
string s="hello"
string cr=chr(13,10)
print a cr b cr c cr f cr s cr
split:
DLL:
$filename "o.dll"
$dll
uses rtl32
'sharable globals
int a=1
int b=2
int c=3
float f=1.5
string s="hello"
function shareGlobals() as sys export
=====================================
return @a
end function
Main Program:
extern lib "o.dll"
! shareGlobals
end extern
sys sg=shareGlobals()
bind sg {
int a
int b
int c
float f
string s
}
string cr=chr(13,10)
print a cr b cr c cr f cr s cr