From RTSC-Pedia
[printable version] [offline version] | offline version generated on 04-Aug-2010 21:08 UTC |
XDCscript - xdc.loadCapsule
Load specified capsule
Contents |
Synopsis
| var capsuleObject = xdc.loadCapsule(capsulePathName); |
Parameters
- capsulePathName
- path string of the capsule file to load; e.g., "ti/sysbios/BIOS.xs". The capsule file is located via xdc.findFile().
Description
xdc.loadCapsule() loads and runs the XDCscript code in the specified file (also known as a capsule). The first time a capsule is loaded, all variables and functions defined in the file are "bound" to a newly created object which is the return value of xdc.loadCapsule(). Subsequent calls to xdc.loadCapsule() with the same capsule file will return the object created the first time the capsule is loaded. So, the code in a capsule is run just once when the capsule is loaded. Functions defined within the capsule can, of course, be run repeatedly.
Return Value
xdc.loadCapsule() returns a JavaScript object whose properties are the functions and variables defined in the capsule.
Throws
This method may throw an xdc.services.global.XDCException exception with one of the following ids:
- "xdc.FILE_NOT_FOUND" - in the event that the specified capsule (JavaScript file) can not be found along the package path.
[printable version] [offline version] | offline version generated on 04-Aug-2010 21:08 UTC |