|
Contents | Previous | Next | Subchapters |
| Syntax |
local variable = value
|
| See Also | assignment , const |
local y = 7
print y
and you enter the commands
y = 8
include TEMP.OMS
O-Matrix will respond
7
because the value of y within the file
TEMP.OMS is 7. If you continue by entering
print y
O-Matrix will respond
8
If a function is defined after a local variable,
the local variable is visible within the function.
This is different variables that are not defined as local because they
require a
global
statement to make them visible within a function.
If the file TEMP.OMS contains
clear
local z = 10
function f() begin
print z
end
f
and you enter
include TEMP.OMS
O-Matrix will respond
10
local statement can only appear in a file
(not at the command line)
and it cannot be inside of any function.