Observations about Global, Shared, and Protected
Posted: Sun Jul 06, 2003 6:22 pm
It seems to me that the place to use Global or Shared is in procedures rather than in the main code.
This works:
This doesn't
Neither does this:
This brings to mind, "What good is Protected then?" since it appears that variables defined in a procedure default to Protected anyway.
Thoughts?
This works:
Code: Select all
a.s
Procedure MyProc()
Global a.s
a="somethingnew"
EndProcedure
a="something"
Debug a
MyProc()
Debug a
EndCode: Select all
Global a.s
Procedure MyProc()
a.s="somethingnew"
EndProcedure
a="something"
Debug a
MyProc()
Debug a
EndCode: Select all
a.s
Procedure MyProc()
a.s="somethingnew"
EndProcedure
a="something"
Debug a
MyProc()
Debug a
EndThoughts?