Forward or external definition of functions is done by defining the function header followed by a semicolon: xtern(var b);
External declarations are necessary when using functions that are loaded at runtime (see sysLoadScript and sysLoadLibrary). Usually you will have the external definitions in a file bound in by #include or#loadScript. Functions loaded at compile-time need no forward declaration if they are loaded before use. Static functions are visible only to the module they were defined in: // calcXy is a local function not visible
// by other modules:
static var calcXy(var x, var y)
{
....
} // calcXy
|