Return statement, Annotating scripts, 7 return statement – Micromod MOD: 30ML Display Script Guide User Manual
Page 49: 8 annotating scripts
MOD 30ML Display Guide
Display Scripts
3.2.7 RETURN
Statement
The RETURN statement indicates immediate exit from an event script. This prevents the
script from performing any additional functions, including pre-defined system level
functions. In other words, RETURN statements are used to keep the instrument operating
system from taking over a key event that is normally defined by the system, when a
custom script has been developed for that key. RETURN statements would be used at the
end of key event scripts for the Alarm, Tag, Up and Down keys. If the RETURN
statement is not used at the end of a key event definition, which is normally defined by the
system (such as Alarm), the custom function will be processed and then the system-
defined functions for that key will happen as well.
A symptom of this is the Alarm key bringing up active alarms after it has performed its
special function.
Key events that are normally system defined can be returned back to the system by
making the RETURN statement conditional.
3.2.8 Annotating
Scripts
Comments or notes may be inserted in a script file for reference. Comments must start
with a forward slash followed by an asterisk ( /* ), and end with an asterisk followed by a
forward slash ( */ ). Text enclosed within these symbols is not executed as script.
This method can also be used to temporarily disable sections of script during
troubleshooting.
Example of
annotated script
SCROLL_PRESSED:
/* when scroll key is pressed */
{
IF SCRLCNT >= 1 THEN
/* if the input SCRLCNT is >=1 */
SCRLCNT = 0;
/* set SCRLCNT to zero */
ELSE
SCRLCNT = SCRLCNT + 1;
/* otherwise add 1 to SCRLCNT */
}
3 - 11