Format phrase
Specifies one or more attributes for a widget.
Syntax
at-phrase
The column, row and column, or x and y pixel location you want the display to start. The AT option does not left justify the data; it simply indicates the placement of the data area.
See the AT phrase reference entry for more information.ASdatatype
LIKEfield
Creates a frame field and variable with the same definition asfield
.The LIKE option in a DEFINE VARIABLE statement, DEFINE WORK-TABLE statement, or Format phrase requires that a particular database is connected. Since you can start up an ABL application session without connecting to a database, use the LIKE option with caution.ATTR-SPACE | NO-ATTR-SPACEAUTO-RETURN
Causes the AVM to automatically move out of a field as if you pressed RETURN. When you enter the last character in the field, the AVM automatically moves out of the field. If this happens on the last field of a data entry statement, the AVM functions as if you pressed GO.For the purposes of AUTO-RETURN, entering leading zeros in a numeric field does not count as filling the field. For example, suppose you define a numeric field as follows:
If you enter a 09 into the field, the AVM does not AUTO-RETURN. To get the AUTO-RETURN behavior in this situation, define the field as CHARACTER with a format of "99".BGCOLORexpression
BLANKCOLONn
TOn
COLUMN-LABELlabel
Names the label you want to display above the field. If you want the label to use more than one line (stacked labels), use an exclamation point (!) in the label to indicate where to break the line. For example:
The AVM does not display column labels if you use the SIDE-LABELS or the NO-LABELS option with the Frame phrase.You must enclose the label string in quotation marks. If you want to use the exclamation point (!) as one of the characters in a column label, use two exclamation points (!!
).DEBLANKDCOLORexpression
DISABLE-AUTO-ZAP
Specifies whether the value of the AUTO-ZAP attribute will be ignored. See the AUTO-ZAP attribute reference entry. This option only applies to fill-ins.The following example defines a frame with two fill-ins, both of which specify the DISABLE-AUTO-ZAP option:
FGCOLORexpression
FONTexpression
FORMATstring
Represents the format in which you want to display theexpression
. You must enclose string in quotation marks (""). If you do not use the FORMAT option, ABL uses the defaults shown in Table 38.
Table 39 lists the default formats for the Other expression.
Table 39: Default data type display formats Data type Default display format CHARACTER x(8) CLASS1 N/A DATE 99/99/99 DATETIME 99/99/9999 HH:MM:SS.SSS DATETIME-TZ 99/99/9999 HH:MM:SS.SSS+HH:MM DECIMAL ->>,>>9.99 HANDLE2 >>>>>>9 INT64 ->,>>>,>>9 INTEGER ->,>>>,>>9 LOGICAL yes/no MEMPTR3 See the footnote at the end of this table. RAW3 See the footnote at the end of this table. RECID >>>>>>9 ROWID3 See the footnote at the end of this table.
1If you display a class instance using the MESSAGE statement, ABL automatically invokes the ToString( ) method (provided by the Progress.Lang.Object class) on the object reference. To display a class instance in a frame (for example, using the DISPLAY statement), you must first explicitly convert the object reference to a displayable type using the INT64 function, the INTEGER function, the STRING function, or the ToString( ) method.
2To display a HANDLE, you must first convert it using either the INT64 or INTEGER function and display the result.
3You cannot display a MEMPTR, RAW, or ROWID value directly. However, you can convert it to a character string representation using the STRING function and display the result. A ROWID value converts to a hexadecimal string, “0xhexdigits
,” wherehexdigits
is any number of characters “0" through “9" and “A” through “F”. A MEMPTR or RAW value converts to decimal integer string.You can use the FORMAT option with the UPDATE and SET statements to store a character string that is longer than the field length you define in the Data Dictionary or in a DEFINE VARIABLE statement. This is possible because ABL stores data in variable-length fields.
You can also use the ASSIGN statement to store data in a field or variable that is longer than the predefined format of that field or variable.
However, the Data Dictionary load program only loads character data that is no longer than the format you defined in the Dictionary. For more information on data formats, see OpenEdge Getting Started: ABL Essentials.HELPstring
Represents a character string that you want to display whenever the user enters the frame field for the field or variable. When the user leaves the frame field, the AVM removes the help string from the message area. You must enclose the string in quotation marks ("").If the input source is not the terminal, the AVM disregards any HELP options.LABELlabel
[ ,label
] . . .
Represents a character string that you want to use as a label for a field, variable, or expression. You must enclose the string in quotation marks (""). Table 40 shows the order ABL uses to determine the label for a field, variable, or expression.
Table 40: Determining labels LABEL string Dictionary label Field name LIKE field Variable name Field 1 2 3 N/A N/A Variable 1 N/A N/A 2 3 Expression 1 N/A N/A N/A N/ANote: If you use side labels, Windows allows a user to transfer focus to field-level widgets by pressing ALT and one of the letters in the widget’s label. This is called a mnemonic. Specify the letter by preceding it with an ampersand (&) when specifying the LABEL option. Ending a label with an ampersand might produce undesired behavior. If you want a literal ampersand within a label, enter two ampersands (&&) inlabel
. If you specify more than one widget with the same mnemonic, the AVM transfers focus to each of these in tab order when you make a selection.NO-LABELSNO-TAB-STOP
Specifies that the widget is not in its parent frame’s tab order.The following example shows defining a frame with two fill-ins, both of which have the NO-TAB-STOP option specified:
See the TAB-STOP attribute reference entry for related information.PFCOLORexpression
VALIDATE (condition
,msg-expression
)
Specifies a value that you want to validate against the data entered into a screen field or variable. Thecondition
is a Boolean expression (a constant, field name, variable name, or expression) whose value is TRUE or FALSE.When you use the VALIDATE option to validate a specific field, any reference to that field incondition
is assumed to be an input field. For example, in the following statement, the AVM assumes thePromiseDate
field is an input field:
The previous statement is equivalent to the following statement:
The validation is based on the value ofOrderDate
prior to the SET statement. If you want to validate the value ofPromiseDate
against the input value ofOrderDate
, use this statement:
If you try to validate a field whose reference is ambiguous, the AVM tries to resolve the ambiguity by referencing the table that contains the record being updated. In the following example, theSalesRep
field is ambiguous because it exists in both the Order table and the Customer table. The AVM resolves the ambiguity by validating theSalesRep
field in the Order table, since the Order table is being updated.
If the reference is to an array field and has no subscript, the AVM assumes you want to use the subscript of the field that is being prompted.If the value ofcondition
is FALSE, usemsg-expression
to display a specific message. You must enclosemsg-expression
in quotation marks (" ").The AVM processes validation criteria whenever the user attempts to leave the frame field. If the frame field value is not valid, the AVM displaysmsg-expression
in the message area, causes the terminal to beep, and does not advance out of the frame field.If you tab a frame field, make no changes, and leave the field, the AVM does not process the validation criteria specified with the VALIDATE option until the you press GO (F1). If you press ENDKEY or END-ERROR, or an error occurs, the AVM does not test the validation criteria specified with the VALIDATE option.If the input source for the procedure is a table, the AVM validates each input field (except those with a value of "-"). If the result of the validation is FALSE,msg-expression
is displayed and the AVM treats the validation as an error.To suppress the Data Dictionary validation criteria for a field, use this VALIDATE option:
When you use the VALIDATE option in a procedure to specify validation criteria for a field, that validation criteria applies to all other references to that field in the same frame:
In this example, the AVM applies the validation criteria on the second UPDATE statement. The AVM also applies the validation criteria to the first UPDATE statement because both UPDATE statements use the same frame. Scope references to the same field to different frames if you do not want a VALIDATE option to affect all references to that field.view-as-phrase
Specifies the type of widget. This is the syntax for view-as-phrase:
For more information onview-as-phrase
, see the VIEW-AS phrase reference entry.WIDGET-IDid-number
Specifies a widget ID for a field or variable widget to display in a frame. The value ofid-number
must be an expression that evaluates to an even integer value between 2 and 65534, inclusive, and must be unique across all widget IDs in the window or dialog box.If you specify an invalid ID, the compiler displays an error message. This option is supported in graphical interfaces only, and only in Windows.ExampleThis procedure lets the user update Customer records after entering the password “secret.” The format phrase on the
Phone
field describes the display format of that field.
Notes
- The ATTR-SPACE/NO-ATTR-SPACE designation in a Frame phrase takes precedence over an ATTR-SPACE/NO-ATTR-SPACE designation in a Format phrase. The ATTR-SPACE/NO-ATTR-SPACE designation in a Format phrase takes precedence over an ATTR-SPACE/NO-ATTR-SPACE designation in a COMPILE statement.
- If you have enabled application-defined widget IDs in your ABL GUI application, by specifying the Use Widget ID (
–usewidgetid
) startup parameter, then the AVM uses the value specified in the WIDGET-ID option to set the WIDGET-ID attribute for this widget when it creates the widget at run time, instead of using the widget ID it normally generates by default. If you have not enabled application-defined widget IDs, then the AVM ignores this option setting at run time.For more information about the WIDGET-ID attribute, see its reference entry in the "Handle Attributes and Methods Reference" section. For more information about the Use Widget ID (–usewidgetid
) startup parameter, see OpenEdge Deployment: Startup Command and Parameter Reference.- For SpeedScript, these options are invalid: BGCOLOR, DCOLOR, FGCOLOR, FONT, PFCOLOR,
view-as-phrase
.- With respect to internationalization, some double-byte and UTF-8 multi-byte characters display and print in one or two columns. Each unit in the format string represents one physical column. To display or print a character that requires two columns, the FORMAT phrase must specify two columns. For more information, see OpenEdge Development: Internationalizing Applications.
See also
OpenEdge Release 10.2B
|