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 survey, but you can switch it off in Survey Designer's Item Editor menu (refer to the separate Survey Designer documentation for further details).
The following script editing areas support the highlighter capabilities:
- Script nodes in Survey Designer.
- 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. A drop-down list of all the functions corresponding to the text string you have typed, opens.
The figure below shows the Syntax Highlighter in action:
Figure 1 - Synax Highlighter in action
Syntax Highlighter 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.