VSR KeyWord

Apart from the tags a common set of services are provided bye the VscriptRunner or the component that interprets the script. Tags can obtain these services by messaging to the VScriptRunenner using the keyword vsr as its identifier.

It understands the following messages.
load  - load(arg) Used to asynchronously start loading the file.

reload  -reload(arg) Reload the script.

unload  -unload(arg) Unload the script.

interpret -interpret(arg) Interpret the loaded script.

print  -print(arg) Print the specified value on the standard output.

run  -run(arg) Run the interpreted script.

show  -show() Show the first visible component loaded.

loadfile -loadfile(arg) Load the specified file.

savefile -savefile(arg1,arg2)    arg1 is file name, arg2 is contents to be saved.

setbaseurl -setbaseurl(arg)    arg is the new base url. The default base is the url of the interpreted script.

sinterpret -Interpret the script.

selectfile -selectfile(arg1,arg2) Show the file dialog. Arg1 is the identifer that can be used to get name or contents of selected file. Arg2 is the text to be displayed on the file dialog.

sinterpret method

 The sinterpet method is used to interpret the specified script. The following variations of the method are available.

sinterpret(arg1,arg2) -arg1 is the identifer used to refer to unload the script if necessary. arg2 is the actual script to be interpreted.(not the filename).

sinterpret(arg1,arg2,arg3)  -arg3  is the name of the form that holds the visible components in the interpreted script.

sinterpret(arg1,arg2,arg3,arg4) -arg4 is the pos value that specifies the location where the visible components in the interpreted script is to be placed.

Data Values Supported

file: identifer - returns the contents of the file.

name: identifer - returns the name of the file.

result- Holds value true if user has selected a file in response to selectfile message.

userdir- Returns the user directory, ie the directory holding the interpreter.
 

The files need to be previously loaded using loadfile method or using the select file method. The identifer is the name of the file specified in load file method as argument or the identifer used to identify the selected file is select file method.

Examples

vsr.selectfile(script1),    -    Shows the file dialog and file selected by user is referred to using the script1 identifier.
vsr.print(name:script1),   -    Prints the URL of the chosen file.
vsr.print(file:script1),    -    Prints the contents of the chosen file.