Script Editor

Command: Tools > Epina ImageLab Scripts > Script Editor

The script editor consists of the following four windows: (1) the script editor where you input your script code; (2) the status window which provides feedback during the execution of the script code; (3) the console window which allows you to output information during the execution of the script and which serves as an output device of the Function Call Monitor; and (4) the debugger window which supports debugging a script.

The script editor is a flexible and powerful text editor which provides syntax highlighting and parameter completion support for the Epina ImageLab script language. It can open up to eight scripts in parallel which are organized by tabsheets. The tabs show the filename of the corresponding script. Clicking the "Execute Script" button compiles and starts the currently visible script.

Hint: A quick introduction to the script editor can be found in this video tutorial.

Parameter Completion

The editor supports parameter completion of known functions (i.e. all functions and procedures of the ILabPascal library). When typing the opening paranthesis of a parameter list of a library function the editor automatically displays the list of declared parameters of this function as a hint below the text cursor:

Thus you need not remember all the parameters of all available functions, which saves a lot of time during programming. Further, if you want to check the parameters of an already typed function call you can force the declared list of parameters to pop up by clicking into the parameter list and pressing Ctrl-M.

Code Proposal

The editor can provide you with a list of available ILabPascal functions which you can select from (i.e. all declarations, functions and procedures of the ILabPascal library). You can invoke the tool by pressing Ctrl-J:

The displayed list shows all functions which match the text at the cursor. The list of functions starts with all declarations whose names begin with the already written text, followed by all remaining functions and declarations which contain this text as a substring. In this way you can easily find a suitable function, even if you remember only a partial string of the full function name.

The first column of the code proposal window indicates the type of the variable or function, the second column shows the class the function is a member of and the third column shows the declaration. Move the selection bar by using the arrow keys and press either <ENTER> or Ctrl-<ENTER> to select and copy a particular declaration. Using <ENTER> (without the Ctrl key) will copy only the function name, pressing <ENTER> while holding the Ctrl key copies the entire declaration (which might come in handy if you want to copy the parameters to the var section of your code).

The console window is for debugging purposes only. Any output to the console window is invisible if the script is started outside the script editor. There are a few specific functions which control the output to the console: couts, couti, coutf and FuncMon.

Hint: You can define a template script in the preferences. This template script is automatically loaded when you click the "new script" button. It should already contain the most important structures of your scripts, thus wasting less time when creating a new script from scratch.