home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
- PRODUCT : Paradox NUMBER : 488
- VERSION : 3.0
- OS : PC-DOS
- DATE : June 12, 1989 PAGE : 1/2
-
- TITLE : An Example of the ACCEPT Command
-
-
-
-
- The ACCEPT command
-
- The ACCEPT command waits for user to input from the keyboard and
- assigns the keyboard input to a variable which you define. It is
- necessary to define the data type the variable name in the
- command. Additional options such as Pictures and Lookup Tables
- can also be included. See the PAL guide, page 261 for a complete
- list of options.
-
- It is important to use a WHILE loop when using the ACCEPT
- command. Otherwise, if the user presses [ESC] and a variable was
- not previously defined, Retval returns false and it is not
- possible to loop back. If the variable had been defined, the
- value of the variable would be accepted just as if the user had
- typed it in for the first time. It is also necessary, as you
- will see in the code below, to trap for bad data (table that
- doesn't exist).
-
- While(true) ;Start the loop
- Clear ;clear the screen
- @ 1,2 ?? "Enter Name of Table to be processed: "
- ;Prompt the user
- @ 1,38 Accept "A10" ;at a position Accept a string
- To ztable ;to a variable ztable
- Clear ;clear the screen
- If retval = False ;If the user pressed [Esc] the
- ;system varible retval will be
- ;set to false. Trap for this.
- Then ;Then
- Message "You Pressed Escape! Press any key to return."
- ;Give the user a message
- z=Getchar() ;Wait for a keypress
- Loop ;loop back to while(true) and do it
- ;over
- Endif ;End the If loop
- If NOT Istable(ztable)
- ;If they made it this far then the
- ;variable was assigned properly.
- ;Here we need to check to see if
- ;input was valid table name
- Then Message "Not a valid Table Name!"
- ;if not Message the user
- z=Getchar() ;Wait for a character
-
-
-
-
-
-
-
-
-
-
-
-
-
- PRODUCT : Paradox NUMBER : 488
- VERSION : 3.0
- OS : PC-DOS
- DATE : June 12, 1989 PAGE : 2/2
-
- TITLE : An Example of the ACCEPT Command
-
-
-
-
- Loop ;Loop back around
- EndIf ;End the istable if loop
- Quitloop ;We got a valid table if we made
- ;it this far
- EndWhile ;Close the While loop
-
- View ztable ;View the table the user wanted
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-