Where are "constants" defined?
- Jasmin Boller (Deactivated)
Owned by Jasmin Boller (Deactivated)
Q
Where are "constants" defined?
A
netSCRIPT does not know constants just values and their assignment to a variable such as MY_STATE_INIT_DONE = 1
In order not to let netSCRIPT assign a "constant" value each called cycle you should place the assignment into a code segment that is called once during runtime.
Example Code:
if mystate == nil then
-- script is in init state
MY_STATE_INIT_DONE, MY_STATE_1, MY_STATE_2 = 1,2,3
…
mystate = MY_STATE_INIT_DONE
else
...