home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / t / tech91.zip / TI796.ASC < prev   
Text File  |  1991-08-26  |  2KB  |  67 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox                                NUMBER  :  796
  9.   VERSION  :  2.0 & up
  10.        OS  :  DOS
  11.      DATE  :  August 26, 1991                          PAGE  :  1/1
  12.  
  13.     TITLE  :  The SELECT Command for variables in Menu Choices
  14.  
  15.  
  16.  
  17.  
  18.   In menu equivalent scripts, (i.e. scripts that simulate menu
  19.   selections) menu selections are automated into scripts by placing
  20.   the menu choices in curly braces.  For example this is a simple
  21.   query script:
  22.  
  23.        {Ask} {table1} Check Do_it!
  24.  
  25.   A problem arises when a menu choice is variable.  If you wanted
  26.   to query different tables with the same script, you could use the
  27.   SELECT command to simulate selecting a table based on the value
  28.   of a PAL variable.  Say you have five tables in the C:\DATA
  29.   directory which you would like to query in the same manner.  You
  30.   could do table selection based on the assignment of the variable
  31.   'tbl' using the SHOWTABLES command.  The following shows making a
  32.   table selection using the SELECT command.
  33.   _________________________________________________________________
  34.  
  35.   SHOWTABLES                             ; show list of tables
  36.     "c:\\DATA"
  37.     "Highlight name of the table to query, then press Enter."
  38.  
  39.   TO tbl                                 ; assign tablename to tbl
  40.  
  41.   {Ask} SELECT tbl CHECK                 ; select the table using
  42.   Do_it!                                 ; the SELECT command
  43.  
  44.   ; or you could also use the ACCEPT command for user input.
  45.   _________________________________________________________________
  46.  
  47.   @ 10,10 ?? "Enter a table's name for querying: " ; put a prompt
  48.                                                    ;    on screen
  49.   ACCEPT "A8" REQUIRED TO tbl                      ; accept a value
  50.                                                    ;    from user
  51.  
  52.   IF NOT retval THEN                           ; retval = False if
  53.      RETURN "No Table selected"                ;    <Esc> was press
  54.   ENDIF
  55.  
  56.   {Ask} SELECT tbl CHECKPLUS
  57.   Do_It!
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.