VA FileMan V. 22.0 Programmer Manual Banner


 

Main Chapter Getting Started Manual Advanced User Manual

Classic VA FileMan API


^DIWP: Formatter/Word-processing Print

Call ^DIWP to format and (optionally) output any group of text lines.

Before calling ^DIWP, you should kill the global ^UTILITY($J,"W").

^DIWP works in two modes (based on whether the DIWF input parameter contains "W" or not):

  1. In ^DIWP's "accumulate" mode, repeated calls to ^DIWP accumulate and format text in ^UTILITY($J,"W"). After you have finished accumulating text, if you want to write the text to the current device, you should call ^DIWW. ^DIWW writes the accumulated text to the current device with the margins you specified in your calls to ^DIWP and then it removes the text from ^UTILITY.

  2. In ^DIWP's "write" mode, if the text added to ^UTILITY($J,"W") by ^DIWP causes one or more (that is, n) line breaks, n lines are written to the current device(and the remaining partial line is stored in ^UTILITY. This leaves one line of text in ^UTILITY once all calls to ^DIWP are completed. To write the remaining line of text to the current device and remove it from ^UTILITY, call ^DIWW.
Input Variables
X

The string of text to be added as input to the formatter.

The X input string may contain |-windows, as described in the "Formatting Text with Word Processing Windows" topic in the "Advanced Edit Techniques" chapter of the "VA FileMan Advanced User Manual" (e.g., |SETTAB(9,23,44)|). The expressions within the windows will be processed as long as they are not context-dependent; that is, as long as they do not refer symbolically to database field names. Thus, |TODAY| will cause today's date to be inserted into the formatted text, but |SSN| will be printed out as it stands, because it cannot be interpreted in context.

DIWL

The (integer-valued) left margin for the text. Set this to a postive number, 1 or greater. Do not change the value of DIWL if you are making repeated calls to ^DIWP to format text.

DIWR

The (integer-valued) right margin for the text.

DIWF

A string of format control parameters. If contained in DIWF, the parameters have the following effects:

W

If the DIWF parameter contains "W", ^DIWP operates in "write" mode If the DIWF parameter does not contain "W", ^DIWP operates in "accumulate" mode. See above for the discussion of these two modes.

When making repeated calls to ^DIWP, don't mix modes. Use "write" or "accumulate" mode, but don't switch between them.

Cn The text will be formatted in a column width of n, thus overriding the value of DIWR.
D The text will be in double-spaced format.
In The text will be indented n columns in from the left margin (DIWL).
N Each line will be printed as it appears in the text (no-wrap). If DIWF contains N, the value of DIWR will be ignored. See the "Advanced Edit Techniques" chapter in the "VA FileMan Advanced User Manual" for details about word wrapping.
R The text will be in right-justified format.
| Word processing windows (material within vertical bars) will not be evaluated. The window will print as it exists in the word processing field.

 


Reviewed/Updated: March 10, 2007