pragma

The use of this function will allow the ITP Model to override selected features in the execution process and the creation of result documents. This function is designed to be as general purpose as possible. Its use will be extended in future releases of ITP.

pragma ( feature_name;feature_value )

The result of this function is of type TEXT and contains the necessary word processor instructions that will produce the effect requested. These instructions should be put into the result document with the construction @(pragma (...)) unless noted otherwise.

The pragma function requires two parameters of type TEXT:

  1. feature_name, type TEXT. The type of feature to be modified.
  2. feature_value, type TEXT. The new value of the feature.
Currently supported features:

Feature

Value

Effect

Template

path\template name

Replaces the template of the result document with the template given as feature_value. In Microsoft Word DOC models, the template must be specified as a file system path. In Microsoft Word DOCX models, the template must be specified as a valid URL. This URL will normally be of the form file:///<file system path>, e.g. "file:///x:\templates\sample.dotm".

UnicodeEuro

Y or N

Activates (Y) or de-activates (N) within the model document the translation of single byte Euro characters to Unicode Euro characters. This functionality is only supported for Microsoft Word DOC models. Also refer to Euro functionality in Microsoft Word documents.

CurrencyEuro

Y or N

Activates (Y) or de-activates (N) within the model document the translation of the International Currency Symbol to Unicode Euro characters.
This functionality is only supported for Microsoft Word models (both DOC and DOCX). Also refer to Euro functionality in Microsoft Word documents

FormField:bookmark:Default

Any text

Will set the default content for a Form Field. The formatting of the Default text should match the formatting mask (Refer to the next item for more information).
This functionality is only supported for Microsoft Word DOC models.
Refer to ITP statements in Microsoft Word Forms for more information on using Form fields.

FormField:bookmark:Format

A formatting mask

Will set the formatting mask for a Form Field. This functionality is only supported for Microsoft Word DOC models.
Refer to ITP statements in Microsoft Word Forms for more information on using Form fields.

FormField:bookmark:Help

Any text

Sets the text of a Form Field that is shown if the end user presses F1. This functionality is only supported for Microsoft Word DOC models.
Refer to ITP statements in Microsoft Word Forms for more information on using Form fields.

FormField:bookmark:Status

Any text

Sets the text of a Form field that is shown in the status bar. This functionality is only supported for Microsoft Word DOC models.
Refer to ITP statements in Microsoft Word Forms for more information on using Form fields.

FormField:bookmark:Checked

Y or N

Y sets the check boxes of a Form Field in the Checked state.
N unchecks the check box.

This functionality is only supported for Microsoft Word DOC models.
Refer to ITP statements in Microsoft Word Forms for more information on using Form fields.

FormPassword

0 or "" (empty)

0 protects the result document with Form Fields with an empty password. An empty value protects the result document with an unknown password.
This functionality is only supported for Microsoft Word DOC models.
Refer to ITP statements in Microsoft Word Forms for more information on protecting documents with Form fields.

RevisionMarking

Y or N

Enables or disables revision marking. This functionality is only supported for OpenOffice.org. Refer to Revision marking for more information on revision marking.

RevisionMarkingActive

Y or N

Enables or disables the tracking of new changes in the document. This functionality is only supported for OpenOffice.org.

RevisionMarkingPassword

password

Changes the revision marking password. If the password is enabled, the end user cannot change the revision marking options. An empty password will disable the password protection.
This functionality is only supported for OpenOffice.org.

Password

password

Sets a password that write protects the section in which the function is called. This functionality is only supported for OpenOffice.org. Refer to Content protection for more information on how to protect content in the result document.

Reset

"textboxchains"

or "lists"

or "list"

Resets aspects of an Microsoft Word document (both DOC and DOCX).

Value "textboxchains" resets the chains of the text boxes in the document. Should be called in the body of the document (in other words, not in the header, footer or text box itself). Refer to the documentation on Text boxes for more information.

Value "lists" resets all numbered lists, so that they restart numbering the next time they are produced as output.

Value "list" resets only the first numbered list that is produced as output after the pragma. (DOCX only)

 

LOCALE:LC_MONETARY

int_curr_symbol

The representation of the multi-character currency code (U).

LOCALE:LC_MONETARY

currency_symbol

The representation of the single-character currency code ($).

LOCALE:LC_NUMERIC

decimal_point

The representation of the decimal point (.).

LOCALE:LC_NUMERIC

thousands_sep

The representation of the thousands separator (,).

AutoInsertSeparator

text

Can be used with the keyword TEXTBLOCK or with the AUTOINSERT keyword in a FORM. It sets the text that is generated after each Text Block.

AutoInsertTerminator

text

Can be used with the keyword TEXTBLOCK or with the AUTOINSERT keyword in a FORM. It sets the text that is generated after the last Text Block.

AutoInsertPrefix

prefix

Can be used with auto insert Text Block questions in a FORM or FORM (dynamic). It contains the prefix of the set of Text Block styles that needs to be applied to the Text Block(s) inserted by the FORM. By default ITP will search for the Text Block styles with a "ITP" prefix. Refer to Lay out of Text Blocks for more information on the lay out of Text Blocks.

AutoInsertParagraph

paragraph sign

Can be used with auto insert Text Block questions in a FORM or FORM (dynamic). It contains the paragraph sign that holds the style that is applied to the Text Block.
It is mainly used when a Text Block needs to be inserted into a table cell.
To insert this Text Block into a table cell the paragraph sign needs to be declared within a table cell itself as well. A corrupted result document could be produced if an incorrect paragraph sign is used.

ChangePassword

0 or "" (empty)

0 protects the result document with an empty password. An empty value protects the result document with an unknown password. This function will activate the same password as the function FormPassword, but without enabling the Form Field protection feature.
This functionality is only supported for Microsoft Word DOC models.

EnhancedUnicodeSupport

Y, N or ?

Overrides the setting EnhancedUnicodeSupport in the current environment for all subsequent text-based comparisons that are performed by the model.
This pragma can be called more than once to switch behavior within the model.
A call to this pragma sets a new value for the setting EnhancedUnicodeSupport, and returns the previous value. The output of the pragma function call does not have to be put into the result document.
The value "?" can be used to inquire the current value of the setting EnhancedUnicodeSupport without changing it.

EnhancedUnicodeMaps

Y, N or ?

Overrides the setting EnhancedUnicodeMaps in the current environment. You can use this pragma only before you make the first MAP assignment. Any attempt to change this setting after the first assignment will result in a fatal error.
A call to this pragma sets a new value for the setting EnhancedUnicodeMaps, and returns the previous value. The output of the pragma function call does not have to be put into the result document.
You can use the value "?" to inquire the current value of the setting EnhancedUnicodeMaps without changing it.

FacingPages

Y, N, M or P

Determines how the setting 'different odd or even' for the headers and footers is controlled. Note that this option affects the whole document, it cannot be changed in different sections.

The following values are supported:

Y: Enable the setting.
N: Disable the setting.
M: Use the setting from the model document.
P: If the function pagestyle is used, enable the setting if any of the template documents has the setting enabled, disable it otherwise. If the function pagestyle is not used, use the setting from the model document. The option P is the default behavior.

This functionality is only supported for Microsoft Word models (both DOC and DOCX).

Incorrect use of this function can result in documents that cannot be opened by the word processor. If a feature is not supported by the word processor support it will be silently ignored.

LOCALE settings

The settings LOCALE set the outcome of the function Format. The symbols set with LOCALE will override the language specific settings for the same when the function Format is used.

Example

@(pragma("Template"; "c:\Word97\Templates\custom.dot"))
@(pragma("UnicodeEuro"; "Y"))
@(pragma("UnicodeEuro"; "N"))
@(pragma("FormField:Amount:Default"; "12,00"))

Example

Obtain the first ten bytes of something regardless of the setting EnhancedUnicodeSupport.

TEXT old_state := pragma ("EnhancedUnicodeSupport"; "N")
ASSIGN first_10_bytes := text_fragment (something; 1; 10)
TEXT ignored := pragma ("EnhancedUnicodeSupport"; old_state)