at-phrasedatatype LIKE fieldASATTR-SPACE NO-ATTR-SPACEAUTO-RETURNexpressionBGCOLORBLANKn TO nCOLONlabelCOLUMN-LABELDEBLANKexpressionDCOLORDISABLE-AUTO-ZAPexpressionFGCOLORexpressionFONTstringFORMATstringHELPlabel , label NO-LABELSLABELNO-TAB-STOPexpressionPFCOLORcondition , msg-expression )VALIDATE (view-as-phraseid-numberWIDGET-ID
AT nCOLUMN column COLUMN-OF relative-positionROW row ROW-OF relative-positionCOLON-ALIGNED LEFT-ALIGNED RIGHT-ALIGNEDX x X-OF relative-positionY y Y-OF relative-positionCOLON-ALIGNED LEFT-ALIGNED RIGHT-ALIGNEDAS datatypeLIKE fieldATTR-SPACE NO-ATTR-SPACECauses 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.
DEFINE VARIABLE x AS INTEGER NO-UNDO FORMAT "99".SET x AUTO-RETURN.BGCOLOR expressionDisplays blanks for the field you are displaying or entering. This is useful for entering passwords.COLON nThe 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 nThe 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
FOR EACH Customer NO-LOCK:DISPLAY Customer.Name COLUMN-LABEL "Customer!Name"Customer.SalesRep COLUMN-LABEL "Name of!Sales!Representative".
END.DCOLOR expressionSpecifies 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.
DEFINE FRAME frame-afill-in-1 DISABLE-AUTO-ZAPfill-in-2 DISABLE-AUTO-ZAPbutton-1WITH THREE-D SIDE-LABELS.FGCOLOR expressionFONT expressionFORMAT stringRepresents 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, ABL uses the defaults shown in Table 39.
Table 39: Table 40 lists the default formats for the Other expression.
If 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.
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.
DEFINE VARIABLE mychar AS CHARACTER NO-UNDO FORMAT "x(3)".UPDATE mychar FORMAT "x(8)".
mychar = "abcdefgh".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.HELP stringRepresents 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 41 shows the order ABL uses to determine the label for a field, variable, or expression.
Table 41: LABEL string LIKE field
Note: 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, the AVM transfers focus to each of these in tab order when you make a selection.
DEFINE FRAME frame-afill-in-1fill-in-2button-1 NO-TAB-STOPWITH THREE-D SIDE-LABELS.See the TAB-STOP attribute reference entry for related information.PFCOLOR expressionSpecifies 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, the AVM assumes the PromiseDate field is an input field:
SET Order.OrderDate Order.PromiseDateVALIDATE(Order.PromiseDate > Order.OrderDate,"Promise date must be later than order date").
SET Order.OrderDate Order.PromiseDateVALIDATE(INPUT Order.PromiseDate > Order.OrderDate,"Promise date must be later than order date").The validation is based on the value of OrderDate prior to the SET statement. If you want to validate the value of PromiseDate against the input value of OrderDate, use this statement:
SET Order.OrderDate Order.PromiseDateVALIDATE(Order.PromiseDate > INPUT Order.OrderDate,"Promise date must be later than order date").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, the SalesRep field is ambiguous because it exists in both the Order table and the Customer table. The AVM resolves the ambiguity by validating the SalesRep field in the Order table, since the Order table is being updated.
FIND FIRST Customer.FIND FIRST Order.UPDATE Order.CustNum Order.SalesRepVALIDATE(LENGTH(Order.SalesRep) > 1, "Invalid sales rep value.").If the value of condition is FALSE, use msg-expression to display a specific message. You must enclose msg-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 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, 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.
VALIDATE(TRUE,"")
FOR EACH Order:UPDATE Order.OrderDate.UPDATE Order.OrderDateVALIDATE(Order.OrderDate LE TODAY, "Can’t be later than today").END.
VIEW-AS editor-phraseFILL-IN NATIVE size-phraseradio-set-phraseselection-list-phraseslider-phraseTEXT size-phraseTOGGLE-BOX size-phraseWIDGET-ID id-numberSpecifies a widget ID for a field or variable widget to display in a frame. The value of id-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.This 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.
DEFINE VARIABLE password AS CHARACTER NO-UNDO.UPDATE password FORMAT "x(6)" BLANKVALIDATE(password = "secret", "Sorry, wrong password")
HELP "Maybe the password is ’secret’ !"
WITH FRAME passw CENTERED SIDE-LABELS.HIDE FRAME passw.REPEAT:PROMPT-FOR Customer.CustNum COLON 20.FIND Customer USING Customer.CustNum.UPDATECustomer.Name LABEL "Customer Name" COLON 20VALIDATE(Customer.Name NE "", "Please enter a name")
Customer.Address HELP "Please enter two lines of address"COLON 20 LABEL "Address"
Customer.Address2 NO-LABEL COLON 20Customer.City COLON 20Customer.State COLON 20Customer.PostalCode COLON 20 SKIP(3)Customer.Phone AT 5 FORMAT "(999) 999-9999"Customer.Contact TO 60WITH CENTERED SIDE-LABELS.END.
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.
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.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |