Checking the syntax of an expression, Cutting, copying, and pasting expressions, Formatting expressions – Rockwell Automation FactoryTalk View Site Edition Users Guide User Manual
Page 550: Example: formatting an expression
F
ACTORY
T
ALK
V
IEW
S
ITE
E
DITION
U
SER
’
S
G
UIDE
20–4
• •
•
•
•
Checking the syntax of an expression
Use the Check Syntax button to verify that the expression you typed uses correct syntax.
If the syntax is invalid, an error is shown in the Check Syntax box.
You can check the syntax at any time while the Expression editor is open. In editors with
an Expression box, the syntax is checked automatically, when you click Accept or OK.
Cutting, copying, and pasting expressions
You can cut, copy, or paste an expression or parts of an expression. How you perform
these actions depends on whether the expression is in a window or in a dialog box.
When you are working in a window, you can use the commands on the Edit menu, the
toolbar, or the keyboard.
When you are working in a dialog box, you can only use the keyboard because there is no
access to the menu bar or toolbar.
When you cut or copy an expression to the clipboard, you can paste it into any other
Expression box. You can also paste it into a command line.
Formatting expressions
You can format expressions using tabs, line returns, and multiple spaces so they are easier
to read. However, do not let tag names, key words, function names, or function arguments
span more than one line.
Example: Formatting an expression
To format this if-then-else statement, you can align the Else with the appropriate If, so the
logic is easy to understand:
If (tag1>tag2) Then 0
Else If (tag1>tag3) Then 2
Else 4
Or you can condense the statement:
If (tag1>tag2) Then 0 Else If (tag1>tag3) Then 2 Else 4