Nested function: Difference between revisions
m
→{{header|M2000 Interpreter}}
No edit summary |
|||
Line 734:
=={{header|M2000 Interpreter}}==
In M2000 functions may have functions, modules, subs, but these are black boxes. We can define globals for temporary use. Subs can use anything from module/function where we call them. First example use Subs inside a module, when call Make_list two local variables, Separator$ and Counter allocated in same space as module's. So when we call Make_item() these variables are visible. At the exit of sub Make_list local variables destroyed. In second example Letter$ pop a string from stack of values (or an error raised if no string found).
<lang M2000 Interpreter>
|