Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
PUBLIC myvar1
LOCAL myvar2
myvar3="private"
LIST MEMORY LIKE myvar* TO scopes.txt noconsole
MODIFY file scopes.txt
PUBLIC goApp
goApp = CREATEOBJECT("empty")
Addproperty(goApp,"cAppname","my fine app")
? goApp.cAppName
somefunction()
FUNCTION somefunction()
PRIVATE ALL
? goApp.cAppname && will error
RETURN 42
ENDFUNC
PUBLIC myvar1
LOCAL myvar2
PRIVATE myvar3
myvar4="private"
getscopes()
MODIFY file scopes1.txt nowait
MODIFY file scopes2.txt
FUNCTION getscopes()
PRIVATE myvar3, myvar4
LIST MEMORY LIKE myvar* TO scopes1.txt NOCONSOLE
myvar4 = "internal"
LIST MEMORY LIKE myvar4 TO scopes2.txt NOCONSOLE
LOCAL ARRAY Array_A[1]
LOCAL ARRAY Array_B[1]
DIMENSION Array_A[2]
DIMENSION Array_C[2]
ACOPY(Array_A, Array_D)
ACOPY(Array_D, Array_B)
PRIVATE PrivateVariable
m.PrivateVariable = "x"
PUBLIC PublicVariable
m.PublicVariable = "y"
LOCAL LocalVariable
m.LocalVariable = "z"
CLEAR
? "m.PublicVariable =",VariableScope("m.PublicVariable", TYPE("m.PublicVariable"))
? "m.PrivateVariable =",VariableScope("m.PrivateVariable", TYPE("m.PrivateVariable"))
? "m.LocalVariable =",VariableScope("m.LocalVariable", TYPE("m.LocalVariable"))
? "m.UndefinedVariable =",VariableScope("m.UndefinedVariable", TYPE("m.UndefinedVariable"))
FUNCTION VariableScope (VariableName AS String, TypeAtCaller AS Character) AS String
LOCAL MemoryNamespace AS String
* make sure we're talking about memory variables
IF UPPER(LEFT(CHRTRAN(m.VariableName," ",""),2)) != "M." AND UPPER(LEFT(CHRTRAN(m.VariableName," ",""),3)) != "M->"
m.MemoryNamespace = "m."
ELSE
m.MemoryNamespace = ""
ENDIF
IF TYPE(m.MemoryNamespace + m.VariableName) != "U"
* is visible at the callee, so it must Private or Public (no distinction can be made)
RETURN "P"
ENDIF
IF m.TypeAtCaller != "U"
* is visible at the caller, then it is local
RETURN "L"
ENDIF
* otherwise, it is undefined
RETURN "U"
ENDFUNC