scriptEditor()
Starts the Script Editor and writes the entered script to a variable.
Synopsis
int scriptEditor(string &scriptstr [,string filestr]);
int scriptEditor(string &scriptstr [,mapping options]);
int scriptEditor(mapping options);
Parameters
Parameter | Meaning | |
---|---|---|
scriptstr | Variable to which the script is written | |
filestr | File to which the script is written. The filepath is given relative to the project directory. | |
options | The mapping containing the options available to this function. The key & value pairs are: | |
"fileName" (string) | Filename of the script file that should be loaded. The filepath is given relative to the project directory. | |
"coverageReport" (string) | Filename of a coverage report xml which should be loaded with the script. | |
"line" (int) | Sets the current line, which the view will center on and have the cursor. | |
The following keys allow the possibility to open a panel in a GEDI instance (e.g.: the perfVisu panel) and position the cursor at a specific shape script in the opened panel editor. Available keys are: | ||
"type" (string) |
Type of the object the script belongs to. This can be one of:
|
|
"scriptName" (string) | The name of the script of a shape. | |
"serial" (int) | The object serial number in the panel. |
Return value
If OK 0, otherwise -1.
Errors
no/incorrect parameters, ...
Description
Opens the Script Editor and writes the control script written in the Editor to the string variable scriptstr. If a file name is given in the optional parameter filestr, the appropriate file is loaded in the Editor and then saved again when it is closed. Valid contents of the variable scriptstr is a syntactically correct control script.
When using the "&scriptstr" parameter, the thread waits until the editor is closed and the return variable is filled. Without this parameter the thread continues after opening the editor.
Example
Assignment of the script contained in the Script Editor to the variable script.
main()
{
string script;
scriptEditor(script);
}
Assignment
Simple configuration
Availability
UI