C5_ACCEPT

 ACCEPT*
 Place keyboard input into a memory variable
------------------------------------------------------------------------------
 Syntax

     ACCEPT [<expPrompt>] TO <idVar>

 Arguments

     <expPrompt> is an optional prompt displayed before the input area.
     The prompt can be an expression of any data type.

     <idVar> is the variable that will hold input from the keyboard.  If
     the specified <idVar> does not exist or is not visible, a private
     variable is created.

 Description

     ACCEPT is a console command and wait state that takes input from the
     keyboard and assigns it as a character string to the specified variable.
     When ACCEPT is executed, it first performs a carriage return/linefeed,
     displays the prompt, and then begins taking characters from the keyboard
     at the first character position following the prompt.  You may input up
     to 255 characters.  When input reaches the edge of the screen, as
     defined by MAXCOL(), the cursor moves to the next line.

     ACCEPT supports only two editing keys: Backspace and Return.  Esc is not
     supported.  Backspace deletes the last character typed.  Return confirms
     entry and is the only key that can terminate an ACCEPT.  If Return is
     the only key pressed, ACCEPT assigns a null value ("") to <idVar>.

 Examples

     .  This example uses ACCEPT to get keyboard input from the user:

        LOCAL cVar
        ACCEPT "Enter a value: " TO cVar
        IF cVar == ""
           ? "User pressed Return"
        ELSE
           ? "User input:", cVar
        ENDIF

 Files   Library is CLIPPER.LIB.

See Also: @…GET @…SAY INKEY() INPUT* KEYBOARD WAIT*

 

Advertisements

6 responses to “C5_ACCEPT

  1. Pingback: C5 UI – Basics | Viva Clipper !

  2. Pingback: C5_WAIT | Viva Clipper !

  3. Pingback: Variable Handling | Viva Clipper !

  4. Pingback: C5_INPUT | Viva Clipper !

  5. Pingback: C5 User Interface | Viva Clipper !

  6. Pingback: C5 Commands | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.