Functions | |
include (first, second,...) | |
Include the named script(s) in the current script. |
The xTuple ERP Scripting API defines the interface between extension scripts and the xTuple ERP C++ core.
include | ( | first | , | |
second | , | |||
... | ||||
) |
Include the named script(s) in the current script.
This lets the script developer put commonly used QtScript (JavaScript) code in a single place and use it in multiple other scripts. All named scripts are included in the order listed. If more than one script exists with the given name, all of them are included in increasing order by script_order. The inclusion is done as the script is executed, so if an include() call appears in the middle of a function, the include will not be done until that function gets called. If any of the included scripts throws an exception while being included, no subsequent scripts in the list will be processed.
For example:
include("soap2js");
This tells the current QScriptEngine to use the contents of the script named "soap2js" and appears near the top of the weatherForAddress.js script.
include("storedProcErrLookup", "xtmfgErrors");
This tells the current QScriptEngine to use the contents of two scripts, one named "storedProcErrLookup" and the other named "xtmfgErrors".
first | The name of a script to include | |
second | Optional: The name of a second script to include |
Generated on Tue Apr 20 12:02:32 2010 | xTuple ERP Programmer Reference, Version 3.5.0 |
![]() |