[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
<expL2> evaluates to false (.F.), input is not allowed, the GET field
cannot be accessed and the cursor moves to the next GET field.

COLOR SCHEME <expN5>
| COLOR <color pair list2>
        Changes standard, enhanced or both color attributes for GET fields. The
standard settings are used with the SAY portion of the @ command, while
enhanced determine the colors that will be used with the GET. For a
complete description of available colors and output options, refer to
the SET COLOR command.

FUNCTION Codes <fcodes>
        A       Allows alphabetic characters only.

        B       Left-justify numeric data within output field.

        C       CR (credit) is displayed after positive number.

        D       Uses current SET DATE format for editing date type data.

        E       Edit date type data as European (BRITISH) date.

        I       Output text is centered in field.

        J       Output text is right-justified in field.

        K       Entire field is selected for editing when cursor is moved to field.

        L       Leading zeros (instead of spaces) are displayed in numeric output.

        M <list>        Specifies multiple preset choices.  <list> is comma-delimited
collection of items.

        R       If used with <format> string that contains characters other than
PICTURE template codes, non-template characters will be displayed but
not stored in <var>.

        S <n>   Limit display width to <n> characters, where <n> is positive
integer.

        T       Trim leading and trailing blanks from field.

        X       DB (debit) symbol is displayed after negative numbers.

        Z       Field displayed as all blanks if numeric value is 0.

        (       Encloses negative numbers in parentheses.

        !       Any character may be entered; however, alphabetic characters will be
converted to uppercase.

               Displays numeric data using scientific notation.

        $       Displays data in currency format.

PICTURE Template Codes
        A       Allows only alphabetic characters to be entered.

        L       Allows logical data only.

        N       Allows letters and digits only.

        X       Allows any character.

        Y       Allows logical Y, y, N, n only, converting y and n to Y and N
respectively.

        9       With character data, allows digits only.  With numeric data, allows
digits and signs.

        #       Allows digits, blanks and signs.

        !       Converts lower-case letters to upper-case letters.

        $       Displays currency symbol (as defined with SET CURRENCY).

        *       Displays asterisks in front of the numeric value.

        .       Specifies decimal point position.

        ,       Separates digits left of decimal point.

+---------------------------------+
|         Program Example         |
+---------------------------------+
This example demonstrates @...SAY/GET and options that are available
with it.  Demonstrated are COLOR, PICTURE, RANGE, VALID and WHEN
options.

Three databases are opened in three work areas.  STATE database is used
as a lookup table to find states and validate their abbreviations.
FUNCTION V_STATE at end of example is a UDF that tests to see if state
abbreviation is correct; if it isn't a popup is displayed with all state
abbreviations in it.

A relation is set between CUSTOMER and PAYMENT databases to pull
information from both files.

SET TALK OFF
SET MESSAGE TO 24
CLEAR
PUBLIC mprompt

DEFINE POPUP popstate FROM 0,60 TO 15,65 PROMPT FIELD state
ON SELECTION POPUP popstate DO deactpop

SELECT 3
USE states INDEX states

SELECT 2
USE payments INDEX pmt_cus

SELECT 1
USE customer

SET RELATION TO cust_id INTO B

GO TOP
STORE .F. TO mexit
@ 0,0 TO 23,79 DOUBLE

DO WHILE NOT mexit
    @ 2,13 SAY 'Company: ' GET company COLOR gr+/b, r/w
    @ 4,13 SAY 'Contact: ' GET contact COLOR gr+/b, r/w
    @ 6,13 SAY 'Address: ' GET address1 COLOR gr+/b, r/w
    @ 8,13 SAY 'City: '  GET city COLOR gr+/b, r/w
    @10,13 SAY 'State: ' GET state PICTURE '!!' ;
             VALID v_state(state);
    COLOR gr+/b, r/w
    @10,28 SAY 'Zip: ' GET zip COLOR gr+/b, r/w
    @14,13 SAY 'Tax Rate: '
    @14,23 GET taxrate PICTURE '9.99' RANGE 3,8  ;
             MESSAGE 'Enter tax rate from 3.00 to 8.00'
    @16,13 SAY 'Payment: '
    @16,22 GET payments.amount PICTURE '$$$$,$$$.99' ;
             WHEN NOT EOF(2) MESSAGE SPACE(50)
    @18,13 SAY 'Date Paid: '
    @18,24 GET payments.date PICTURE '@D' ;
             WHEN NOT EOF(2) DEFAULT DATE()
    @22,30 SAY 'Press <Esc> to exit'
    READ
    SKIP
    IF LASTKEY() = 27 OR EOF()
        STORE .T. TO mexit
    ENDIF
ENDDO
CLEAR

*** A UDF that validates state abbreviations ***

FUNCTION v_state
PARAMETER stateid
SELECT states
SEEK stateid
IF FOUND()
        SELECT customer
    RETURN .T.
ENDIF
DO WHILE NOT FOUND()
        ACTIVATE POPUP popstate
    SEEK mprompt
ENDDO
SELECT customer
REPLACE state WITH states.state
@ 10,21 GET state
CLEAR GETS

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson