$fieldsyntax

Set or return the syntax attributes of the specified field.

AttributeList = $fieldsyntax(Field)

$fieldsyntax(Field) = AttributeList

Example: $fieldsyntax(DISCOUNT_2) = "NED;NPR"

Parameters

Parameters
Parameter Data Type Description
Field String Field name
AttributeList String List of field syntax attributes, or an empty string. Although commas can be used when setting attributes, the retrieved list is always a Uniface associative list.

Return Values

String containing the dynamic field syntax attributes that have been previously set with $fieldsyntax.

Use

Allowed in all component types.

Description

Use the $fieldsyntax function to set or retrieve dynamic syntax attributes of Field for the currently active occurrence.

When setting the field syntax, if AttributeList contains an empty string, the syntax of Field is reset. The structure editor function ^CLEAR also resets the field syntax. Since the structure editor function ^RETRIEVE carries out an implicit ^CLEAR, this also resets field syntax.

When retrieving the field syntax, only syntax attributes that are dynamic and that have previously been set with $fieldsyntax are retrieved. If syntax attributes have been set declaratively, an empty string is returned. You can retrieve declaratively-set field syntax with $fieldinfo("SYNTAX").

Field Syntax Attributes

Code

Description

NDI Do not display the contents of this field.

Note: NDI is a static property—it can only be set before the ProcScript edit statement is executed.

NED Do not allow this field to be edited.
NPR Do not prompt this field.

Not available in the web environment.

HID Hide field. Do not display, edit, or prompt this field. (Equivalent to NDI, NED, and NPR.)

Not valid in character mode ($GUI =$CHR ).

DIM Do not allow editing or prompt this field. In GUI mode, the field is dimmed; in character mode, it is equivalent to NED and NPR.
YDI Display this field.
YED Allow this field to be edited.
YPR Prompt this field.

Note: The field syntax codes YDI, YED, and YPR cannot be set declaratively. They can only be set using $fieldsyntax and fieldsyntax.

Using $fieldsyntax

The following example sets the field syntax for field DISCOUNT_2 to No Edit and No Prompt, if the value in the field DISCOUNT_1 is not zero:

if (DISCOUNT_1 != 0)
   $fieldsyntax(DISCOUNT_2) = "NED;NPR"
endif
History
Version Change
9.1.01 Introduced

Related Topics