Link Search Menu Expand Document (external link)

Rules for all logic text

TABLE OF CONTENTS

  1. Rule 1 - Extra blanks
  2. Rule 2 - Continue on next line
  3. Rule 3 - Case of keywords has no effect
  4. Rule 4 - Single quote is line comment
  5. Rule 5 - Input fields in curly brackets
  6. Keyboard shortcuts for logic text screens

Rule 1 - Extra blanks

Rule 1 Notes
Extra blanks between keywords
and expressions
have no effect.
For example, these IF statements are all the same:

IF ({field1}={field2}) THEN COLUMN={field1} ENDIF
IF ({field1} = {field2}) THEN
COLUMN = {field1} ENDIF

IF
({field1}
=
{field2})
THEN
COLUMN
=
{field1}
ENDIF
IF ({field1} = {field2})THEN
COLUMN = {field1}
ENDIF

IF ({field1} = {field2})
THEN COLUMN = {field1}
ENDIF
WARNING: Extra blanks change text strings,
for example “ABC” and “A B C” are different strings.

Rule 2 - Continue on next line

Rule 2 Notes
Logic text can continue
on the next line.
A backslash (\) is
optional at line end.
In previous versions of SAFR, a backslash (\) was required in order to continue a line
of logic text on the next line. This backslash is no longer required.
The backslash is still allowed for backwards compatibility.
This means the following statements are the same:
IF ({FIELD1} >= 2)\
THEN COLUMN = {FIELD1} ENDIF

IF ({FIELD1} >= 2)
THEN COLUMN = {FIELD1} ENDIF

Rule 3 - Case of keywords has no effect

Rule 3 Notes
The case of keywords
has no effect.
For example, these IF statements are all the same:

IF ({FIELD1} >= COL.2)
THEN COLUMN = {FIELD1}
ELSE COLUMN = COL.2 ENDIF

if ({field1} >= col.2)
then column = {field1}
else column = col.2 endif

If ({Field1} >= Col.2)
Then Column = {Field1}
Else Column = Col.2 Endif

WARNING: Case changes text strings,
for example “ABC” and “abc” are different strings.

Rule 4 - Single quote is line comment

Rule 4 Notes
After a single quote
everything on that line
is a comment
Examples are:
‘ Make col the larger of field1 & col.2
IF ({FIELD1} >= COL.2)
THEN COLUMN = {FIELD1} ENDIF
COLUMN = {field3} ‘ Rest is comment (OK).


WARNING: comments to the left of keywords
result in hiding the keywords
, for example:
IF ({field1} = {field2})THEN
COLUMN = {field1}
’ This comment hides keyword: ENDIF

Rule 5 - Input fields in curly brackets

Rule 5 Notes
Use curly brackets { } to enclose
input fields or names of metadata
from the SAFR Workbench
(such as a lookup path,
logical file, physical file).
Examples are:
{shipping_date}
{product_category}
{CA_Sales_2009_Logical_File}
{Products_Logical_File}
{Products_USA_File}
{Lookup_Sales_to_Product_Category}

Keyboard shortcuts for logic text screens

See topic Keyboard Shortcuts Logic Text