|
Variable tests check database or temporary variables for appropriate values, then supply alternative text to be used in a document. For example, if the organisation you are writing to has a DX number, you will probably want to use that, otherwise the letter will need the full postal address. This can all be coded into documents.
Variable tests must appear in the following format:
[&name,variable name,operator,expression]
The variable test syntax has these parts:
Part |
Description |
&name |
Required. One of the following tests: &IF Used to test for a condition, which when true, determines the text to be merged. It can also be used to test a previously coded '&ASK'. Example: [&IF,sp_mort,=,Yes]We will write to your Building Society for the Deeds. [&ENDIF] In the above example, "We will write to your Building Society for the Deeds" is entered, if the value of 'sp_mort' is 'Yes'. &ELSE Used to test for an alternative paragraph/portion of text. Example: [&IF,pi_driveable,=,Yes]The client's vehicle is driveable, but we are happy to authorise hire for the duration of the repairs. [&ELSE]The vehicle is currently undriveable so we authorise immediate hire, under our usual terms and conditions. [&ENDIF] In the above example, "The client's vehicle is driveable, but we are happy to authorise hire for the duration of the repairs" is entered, if the value of 'pi_driveable' is 'Yes'. However, if the value is 'No', then "The vehicle is currently undriveable so we authorise immediate hire, under our usual terms and conditions" is entered. &ELSEIF Used to test for further conditions. Example: [&IF,client.salutation,=,Sir]faithfully [&ELSEIF,client.salutation,=,Madam]faithfully [&ELSEIF,client.salutation,=,Sirs]faithfully [&ELSE]sincerely [&ENDIF] [&ENDIF] [&ENDIF] In the above example, "faithfully" is entered, if the salutation is either Sir, Madam, or Sirs. Otherwise, "sincerely" is entered. &ENDIF Used to end the conditional tests. |
Variable Name |
Required. Variable name is prefixed by 'ask_' (temporary variable). |
Operator |
Required. Either 'equal to (=)', 'not equal to (<>)', 'greater than (>)', 'less than (<)' or 'contains (^)'. |
Expression |
Optional. Depends on the type of variable being tested, if omitted the test is for no data. |
Notes
No spaces are allowed before or after the commas in the command string.
Character fields should only be tested for 'equal to (=)', 'not equal to (<>)', and 'contains (^)'. Please note that the contains operator is case-sensitive.