The Hazox EMS system allows the use of conditional statements in the “Calculation Spec” portion of field definitions. Several restrictions and cautions exist:
· The statement must include all four statement elements (IF, THEN, ELSE and ENDIF) in that order. There does not have to be a specific result after the ELSE statement (in that case the system does nothing). Statement elements do not have to be capitalized, but it is good form. The closing ENDIF is required.
· An IF..THEN..ELSE..ENDIF statement can only be used with numeric calculations. If a field is used as part of a condition or as a result it must be a numeric field.
· Formulation fields must be enclosed in French Brackets in the form {{Fieldname}.
· The condition statement can use arithmetic equal, not equal, greater than, etc.
An example of a successful statement:
· IF {{09SPG-C}=0 THEN {{09SPG} ELSE {{09SPG-C} ENDIF
This is from 09SPG_PROD in the current version of the RSG database. All the fields referred to are numeric fields.