Foundation > Rogue Wave Script Programming > Loading Rogue Wave Script Modules
 
Loading Rogue Wave Script Modules
Three different types of scripts can be loaded into a scriptable Rogue Wave® Views application:
*Inline Scripts
*Default Rogue Wave Script Files
*Independent Rogue Wave Script Files
Static functions that may be defined in these scripts have a limited function, as discussed in Rogue Wave Script Static Functions.
Inline Scripts
Scripts that you create from ivfstudio while designing graphic panels are called inline scripts. These scripts are saved in .ilv files by ivfstudio. Inline scripts are loaded together with the .ilv files in which they are stored when these files are loaded into a Rogue Wave Views scriptable application. See Making Rogue Wave Views Applications Scriptable.
Default Rogue Wave Script Files
When an .ilv file, such as panel.ilv, that does not contain inline scripts is being loaded into a Rogue Wave Views scriptable application, Rogue Wave Views looks into the directory where the file is located for a Rogue Wave Script file with the same name that has the .js extension and automatically loads it. The panel.js file is called the default Rogue Wave Script file of panel.ilv.
Independent Rogue Wave Script Files
You can load independent Rogue Wave Script modules into a Rogue Wave Views scriptable application using the IlvScriptContext::loadScript method:
IlvScriptContext::loadScript("c:\\myscripts\\myscript.js");
Using this method, you can load Rogue Wave Script files that are shared by several applications.
Rogue Wave Script Static Functions
Inline and default scripts are associated with an .ilv file. The names of static functions defined in such scripts have a limited scope:
*The name scope of a Rogue Wave Script static function is limited to the module where it is defined. It is not visible from other Rogue Wave Script modules.
*It can only be used as a callback for the gadgets in the associated .ilv file and for the gadgets in the subpanels of the gadget container defined by the associated .ilv file, if any.
Here is an example of a static function:
static function OnClick(graphic)
{
graphic.foreground = "red";
}

Version 6.1
Copyright © 2016, Rogue Wave Software, Inc. All Rights Reserved.