DOCUMENT Paragraph

To create form letters, use a DOCUMENT paragraph. It starts with a BEGIN-DOCUMENT command and ends with an END-DOCUMENT command. Between these commands, lay out the letter and insert variables where you want data from the database to be inserted. SQR inserts the value of the variable when the document prints. To leave blank lines in a letter, you must explicitly mark them with .b (see the sample program).

Document markers provide another way to add data to a letter. They are special variables whose names begin with @ (the at sign). They mark a location in the document where you place data from areas external to the document paragraph. You can reference document markers defined in DOCUMENT paragraphs in the POSITION command outside the DOCUMENT paragraph to establish the next printing position.

The sample program demonstrates the use of variables and document markers. SQR prints the content of the variable in the position where it is placed in the DOCUMENT paragraph. For example, in the sample program, the customer’s name is printed on the first line.

Using a document marker gives you more flexibility in positioning the content of variables. The sample program uses a document marker to position the city, state, and zip code because the city name varies in length and, thus, affects the position of the state name and zip code.