In this article
The Syntax Highlighter functionality means that while scripting you no longer need to remember the functions, or look up which properties belong to which classes and which parameters the various methods accept. Instead, all these are available at the touch of a button. The highlighter automatically color-codes key words, and provides lists of selectable options under specific conditions while scripting.
The Syntax Highlighter functionality is on by default for a report, but you can switch it off if required. Click User in the upper-right corner of the window, then in the Application Settings overlay check the Disable script highlighting option.
The following script editing areas support the highlighter capabilities:
- Script nodes in authoring
- Validation and masking of questions
- Reportal scripting
- Data Processing scripting
- JavaScript editors
To use the highlighter, start typing into the scripting area the function you wish to use, then press the Ctrl+Space keys on your keyboard. A drop-down list of all the functions corresponding to the text string you have typed, opens. To open a complete list of all the available functions, press Ctrl+Space without first typing anything into the scripting area. Show meThe figure below shows the Syntax Highlighter in action:
Figure 1 - Example of the Syntax Highlighter in action
Limitations
The Syntax Highlighter has some limitations. No autocompletions are available for implicitly typed objects (objects returned by functions etc.) so
Typing:
f()will not result in an autocomplete suggestion.
Typing:
var d = new Date();
d.
will not result in an autocomplete suggestion.
Typing:
var myDate: Date;
myDate.
will result in an autocomplete suggestion.