import declaration ;
Declares declaration as a variable or function which is external to the current
script, but that the script needs access to it. You use this to provide your room scripts
with access to parts of your global script.
For example:
import int counter;
import function add_numbers (int, int);
This imports an integer variable counter and the function add_numbers from
the global script to enable the current script to call them. You normally place import
statements into the script header so that all rooms can benefit from them.
In order to import the variable, it must have been exported from the global script
with the export keyword.
NOTE: You MUST import external variables with the correct type. If counter
was declared as a short in the global script, you MUST import it as a short, otherwise
your game may crash.
NOTE: You cannot import old-style string variables (this does not
apply to new-style String variables).
|