Progress
Language Reference
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.
AS datatype
Creates a frame field and variable with the data type you specify. This is useful for defining display positions in a frame for use with DISPLAY @ field.
LIKE field
Creates a frame field and variable with the same definition as field.
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 a Progress application session without connecting to a database, use the LIKE option with caution.
ATTR-SPACE | NO-ATTR-SPACE
No effect; supported for backward compatibility only.
AUTO-RETURN
Causes Progress to automatically move out of a field as if you pressed RETURN. When you enter the last character in the field, Progress automatically moves out of the field. If this happens on the last field of a data entry statement, Progress 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, Progress does not AUTO-RETURN. To get the AUTO-RETURN behavior in this situation, define the field as CHARACTER with a format of "99".
BGCOLOR expression
Specifies the background color of the widget in graphical interfaces. This option is ignored in character interfaces.
BLANK
Displays blanks for the field you are displaying or entering. This is useful for entering passwords.
COLON n
The number (n) of the column in which you want the colon of the label to appear. Use this option with SIDE-LABEL frames where the labels are placed to the left of the data and are separated from the data with a colon.
TO n
The number (n) of the column in which you want to end the display. The TO option does not right justify the data; it indicates the placement of the data area.
COLUMN-LABEL label
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.
Progress 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 (!!).
DEBLANK
Removes leading blanks (for use on input character fields only). Leading blanks in the value before input are not removed unless the user changes the value.
DCOLOR expression
Specifies the display color of the widget in character interfaces. This attribute is ignored in graphical interfaces.
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:
FGCOLOR expression
Specifies the foreground color of the widget in graphical interfaces. This option is ignored in character interfaces.
FONT expression
Specifies the font of the widget.
FORMAT string
Represents the format in which you want to display the expression. You must enclose string in quotation marks (
""
). If you do not use the FORMAT option, Progress uses the defaults shown in Table 27.
Table 28 lists the default formats for the Other expression.
Table 28: Default Data Type Display Formats Data Type Default Display Format CHARACTER x(8) DATE 99/99/99 DECIMAL ->>,>>9.99 HANDLE >>>>>>9 INTEGER ->,>>>,>>9 LOGICAL yes/no MEMPTR1 See the footnote at the table bottom. RAW1 See the footnote at the table bottom. RECID >>>>>>9 ROWID1 See the footnote at the table bottom. WIDGET-HANDLE >>>>>>9
- You 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,” where hexdigits 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 Progress 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 the Progress Programming Handbook .
HELP string
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, Progress removes the help string from the message area. You must enclose the string in quotation marks (
""
).If the input source is not the terminal, Progress disregards any HELP options.
LABEL label [ , 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 29 shows the order Progress uses to determine the label for a field, variable, or expression.
Table 29: 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/A
Note that 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 (&&) in label. If you specify more than one widget with the same mnemonic, Progress transfers focus to each of these in tab order when you make a selection.
NO-LABELS
Prevents Progress from displaying a label for a field, variable, or expression.
NO-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.
PFCOLOR expression
Specifies the prompt color of the widget in character interfaces. This attribute is ignored in graphical interfaces.
VALIDATE ( condition, msg-expression )
Specifies a value that you want to validate against the data entered into a screen field or variable. The condition 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 in condition is assumed to be an input field. For example, in the following statement, Progress assumes the promise-date field is an input field.
The previous statement is equivalent to this statement.
The validation is based on the value of order-date prior to the SET statement. If you want to validate the value of promise-date against the input value of order-date, use this statement.
If you try to validate a field whose reference is ambiguous, Progress tries to resolve the ambiguity by referencing the table that contains the record being updated. In the following example, the sales-rep field is ambiguous because it exists in both the order table and the customer table. Progress resolves the ambiguity by validating the sales-rep field in the order table, since the order table is being updated.
If the reference is to an array field and has no subscript, Progress assumes you want to use the subscript of the field that is being prompted.
If the value of condition is FALSE, use msg-expression to display a specific message. You must enclose msg-expression in quotation marks (
" "
).Progress processes validation criteria whenever the user attempts to leave the frame field. If the frame field value is not valid, Progress displays msg-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, Progress 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, Progress does not test the validation criteria specified with the VALIDATE option.
If the input source for the procedure is a table, Progress validates each input field (except those with a value of "-"). If the result of the validation is FALSE, msg-expression is displayed and Progress 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, Progress applies the validation criteria on the second UPDATE statement. Progress 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 on view-as-phrase, see the VIEW-AS Phrase reference entry.
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.
- 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 the Progress Internationalization Guide .
SEE ALSO
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |