Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Artful Two for Clipper 5.0 - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

Syntax

ASK_FOR( cMsg_str, pMemvar [, cPict_str ;
        [, xcVal_str[, lExact[, ncColour ]]]] )

Purpose

Prompt the user for data, using a prompt message and optionally a picture
and a VALID clause.

Arguments

     cMsg_str -- prompt string, 3 dots added to it automatically

     pMemvar -- memvar to GET, initialized to correct data type

     cPict_str -- picture strint to use; defaults to GEN_PIC(pMemvar)

     xcValidator -- code block or function string to macro-expand
                        in a VALID clause

     lExact_on -- logical for exact comparison ON/OFF; defaults to .F.

     ncColour -- if passed, colour to use, else 7

Setup

At a minimum, the message string and variable to fill must be declared,
initialised and passed. The picture string, if passed, must be appropriate
to the variable. If xcValidator is a code block, it must accept a
parameter as inthe example (otherwise, how could it evaluate the
variable?). If it is a string to be macro-expanded, any fields or PRIVATE
variables referenced in it must exist.

Example

     LOCAL memvar := " ", result

     result = ASK_FOR( "Enter a letter from A to F", ;
                       memvar, ;
                       "!", ;
                       { | x | x $ 'ABCDEF' } )

Returns

pMemvar as updated by the user.

Side Effects

If the prompt string and/or memory variable are undefined, the program will
crash. Other parameters are optional. If xcValidator is a string, it
cannot contain more than one parameter (due to Clipper's inability to read
past the first comma in the stringified expression. Use a code block).

Artful Calls

CENTRE, MAKE_STR, GEN_PIC, READ_IT, SHADOWBOX, SYSCOLOR, MACROBLOCK

Source File

AA_ASK.PRG

See Also: GEN_PIC()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson