importScript

importScript ( string idUnique , string _type ) : boolean

Import a script in another script.
Note that you can do this import anywhere in the script (not just at the beginning).
Returns true if the script is importer, else retruns false.
Local variables on the imported script will disappear from the current script. Pass the variables you want to import as globals and use this structure for your functions: myFunction = {param1, param2 -> .... }

Example


setGlobal("changeSomeValues",true)
changePersonne="Frederic"
executeThat={-> console("Welcome!") }

importScript( 387538 )

//display "Welcome!"
//display "Hello, I am Frederic"

The script 387538 :

personne="Jack"

if(get(global, "changeSomeValues"))
{
personne=changePersonne
executeThat()
}

console("Hello, I am "+personne)

//if you run directly this script ->
//display "Hello, I am Jack"

Parameters

idUnique

The unique ID of the script to import

_type (optional)

"INITIAL", "FORPAGE" or "FINAL". It is the part of the script to import. By default, the type is the same than the type context of the current script (if importScript is called in a FORPAGE execution, the FORPAGE script of the other script is used).