Syntax

The general syntax of a field is as follows:

field:field-type [ instruction ]

field-type:date-and-timedocument-automationdocument-informationequations-and-formulasindex-and-tableslinks-and-referencesmail-mergenumberinguser-informationform-field

date-and-time:CREATEDATE | DATE | EDITTIME | PRINTDATE | SAVEDATE | TIME

document-automation:COMPARE | DOCVARIABLE | GOTOBUTTON | IF | MACROBUTTON | PRINT

document-information:AUTHOR | COMMENTS | DOCPROPERTY | FILENAME | FILESIZE | INFO | KEYWORDS | LASTSAVEDBY | NUMCHARS | NUMPAGES | NUMWORDS | SUBJECT | TEMPLATE | TITLE

equations-and-formulas:= formula | ADVANCE | EQ | SYMBOL

index-and-tables:INDEX | RD | TA | TC | TOA | TOC | XE

links-and-references:AUTOTEXT | AUTOTEXTLIST | BIBLIOGRAPHY | CITATION | HYPERLINK | INCLUDEPICTURE | INCLUDETEXT | LINK | NOTEREF | PAGEREF | QUOTE | REF | STYLEREF

mail-merge:ADDRESSBLOCK | ASK | COMPARE | DATABASE | FILLIN | GREETINGLINE | IF | MERGEFIELD | MERGEREC | MERGESEQ | NEXT | NEXTIF | SET | SKIPIF

numbering:AUTONUM | AUTONUMLGL | AUTONUMOUT | BARCODE | LISTNUM | PAGE | REVNUM | SECTION | SECTIONPAGES | SEQ

user-information:USERADDRESS | USERINITIALS | USERNAME

form-field:FORMCHECKBOX | FORMDROPDOWN | FORMTEXT

instruction:fieldfield-argumentswitchesfield-argument switchesswitches field-argument

field-argument:[ " ] text [ " ]

switches:switchswitch switches

switch:formatting-switchfield-specific-switch

formatting-switch:date-and-time-formatting-switchnumeric-formatting-switchgeneral-formatting-switch

field-specific-switch:\field-switch-character [ field-argument ]

field-switch-character:!one or two Latin letters

formula is discussed in §2.16.3, and formatting-switches are discussed in §2.16.4.

If the text in a field-argument contains white space, the delimiting double-quote characters shall be present; otherwise, they are optional. To include a double-quote character in text, it shall be preceded with a backslash (\).
example: : The field argument "\"name\"" results in the argument's actually being "name".
To include a backslash character in text, it shall be preceded with another backslash (\).
example: : File system pathnames on some systems use a backslash as a directory separator, as in the field
INCLUDETEXT "E:\\ReadMe.txt"

in which case, each such separator needs to be preceded with a backslash, as shown above. ]

Arbitrary amount of white space can occur before the first token, after the last token, and between successive tokens, including no white space at all.

example:
DATE
DATE \@ "dddd, MMMM dd, yyyy"
DATE \@ "dddd, MMMM dd, yyyy" \h

The field result of all three is today's date: The first field uses some implementation-defined format and the Gregorian calendar; the second field uses the specified format and the Gregorian calendar; and the third field uses the specified format and the Hijri lunar calendar. When rendered in a US-English context on December 31, 2005, the results of these fields were as follows:

12/31/2005
Saturday, December 31, 2005
AsSabt,   30, 1426
Except for = formula, the terminals of field-type are alphabetic tokens
example: : Some field-type names are ASK, COMMENTS, NEXT, and SET.
. These tokens are called field-type names. Field-type names are case-insensitive.
example: : The field-type names DATE, Date, dAtE, and date are equivalent.
field-switch-characters are case-insensitive.
example: : \b and \B are equivalent.

There is no ordering of switch entries in switches.