Number reversal game: Difference between revisions

Content added Content deleted
No edit summary
Line 2,131: Line 2,131:


Sub CheckStack get a value by reference. Because stack of values always get values, a reference is a copy of a weak reference, so in CheckStack a new variable defined as local ok, and get the reference from weak reference in stack. When a sub exit any new,including local variables removed (deleted). Subs are always local to Module, and have same scope as module scope.
Sub CheckStack get a value by reference. Because stack of values always get values, a reference is a copy of a weak reference, so in CheckStack a new variable defined as local ok, and get the reference from weak reference in stack. When a sub exit any new,including local variables removed (deleted). Subs are always local to Module, and have same scope as module scope.

To display the values of stack we use Stack statement with no arguments.
<lang M2000 Interpreter>
<lang M2000 Interpreter>