Export Formulas


Export formulas can be used to derive values from information stored in the current field or the current record being processed.  An export formula can contain an arithmetic, logical, or string expression, a BASIC function, and external subroutine call or almost any other type of BASIC statement.  Conceptually, an export formula provides the same functionality as I-type dictionaries without the need to create permanent dictionaries and the freedom to use standard BASIC syntax.

The following table lists the most common system variables used in an export formula

Variable Description
FIELD$ This variable contains the information associated with the dictionary or attribute referenced in the Field ID prompt in internal format (e.g. may include dates and/or times in internal format and embedded values and sub-values marks).

Use this field to return information to the Kourier. 

@ID Contains the item-ID of the current record being processed.
@RECORD Contains the contents of the current record in internal format.

Example 1

In this example, the data passed in FIELD$ may contain either a 5-digit (92021) or 9-digit (92021-1457) US postal code or a Canadian postal code (BN9 19R).  The following export formula will return the first 5 digits of a US postal code but will return all digits in a Canadian postal code.

IF LEN(FIELD$) > 5 THEN
  CHK.VAL = FIELD$[1,5]
  IF NUM(CHK.VAL) THEN
    FIELD$ = CHK.VAL
  END
END

Example 2

In this example, the data passed in FIELD$ may contain several values(MICHAELP]STEVENH]KATHYI).  The following export formula will return the last value (KATHYI).

NUM.VNOS = DCOUNT(FIELD$,@VM)
FIELD$ = FIELD$<1,NUM.VNOS>

BASIC Statements to Avoid

You should avoid using any BASIC statements or functions that will stop the processing of a BASIC subroutine.  Examples are, STOP or ABORT.  Instead, you should return an appropriate value in the FIELD$ variable


User Guide - Table of Contents