Using scope variables
Posted: Wed Oct 09, 2013 5:09 pm
One of implementation of scope variables is grouping of variables to virtual scopes.
It is not necessary that scope names can be only DEF function names. Your own scopes are created automatically when you declare scope variable.
For example, you can write:
SCR.WIDTH = SCREEN_WIDTH()
SCR.HEIGHT = SCREEN_HEIGHT()
This way you automatically create "SCR" scope. When you pause your program, all variables are listed grouped by their scopes, so you will see:
SCR:
WIDTH = …
HEIGHT = …
This approach can help you organize variables into scopes for better program layout.
It is not necessary that scope names can be only DEF function names. Your own scopes are created automatically when you declare scope variable.
For example, you can write:
SCR.WIDTH = SCREEN_WIDTH()
SCR.HEIGHT = SCREEN_HEIGHT()
This way you automatically create "SCR" scope. When you pause your program, all variables are listed grouped by their scopes, so you will see:
SCR:
WIDTH = …
HEIGHT = …
This approach can help you organize variables into scopes for better program layout.