Using Rogue Wave Script > Using Rogue Wave Script for Rogue Wave Views in your Application > Writing and Playing Scripts
 
Writing and Playing Scripts
You can edit an inline script attached to a buffer in the script editor. To display this editor, click on the Script Editor icon in the tool bar at the top of the Main window or execute the ShowScriptEditor command.
By default, the script editor appears as part of the Main window, underneath the drawing area. If you want the editor to be displayed in a separate top window, define a panel description for the ScriptEditor panel using the topView property, as shown below:
panel "ScriptEditor" {
topView true;
}
For details, see Rogue Wave Views Studio Panel Description File.
When editing an inline script in the script editor, you do not have to explicitly validate or save it; the script is automatically saved in the .ilv file and read back when you edit your .ilv file again. The inline script you edit is attached to the current buffer. When a buffer is selected, the script editor is updated to edit the corresponding script.
When a container loads your .ilv file, the inline script is also loaded and all the expressions it contains are evaluated. In contrast, when you open an .ilv file in an Rogue Wave Views Studio buffer, script expressions are not evaluated.
When you test the currently edited application, application panels, which are Rogue Wave Views containers, load the .ilv files as well as the inline scripts. When you test the current buffer, Rogue Wave Views Studio writes its contents together with the inline script to a temporary stream and creates a container that loads that stream.
Scripts can also be written in a separate external file, with the .js extension, using any text editor. When loading an .ilv file, the Rogue Wave Views container checks whether there is a .js file with the same name in the current directory. If the container finds such a file, it loads it. You can explicitly load and evaluate an external script file by executing the Rogue Wave Views Studio LoadScript command or by calling the Rogue Wave Script function loadFile.

Version 5.5.1
Copyright © 2012, Rogue Wave Software, Inc. All Rights Reserved.