home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / VREXX2.ZIP / vrexx.txt < prev   
Text File  |  1992-09-11  |  103KB  |  3,673 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                                                                         VREXX
  14.                                          VISUAL REXX FOR PRESENTATION MANAGER
  15.                                                                   VERSION 1.0
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.                                                             September 9, 1992
  24.  
  25.  
  26.                                                                Richard B. Lam
  27.  
  28.  
  29.                                               IBM T.J. Watson Research Center
  30.                                                            Route 134  POB 218
  31.                                                   Yorktown Heights, NY  10598
  32.  
  33.  
  34.                                                 (C) Copyright IBM Corp.  1992
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                                 (C) COPYRIGHT IBM CORP.  1992
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. ii  VREXX:  Visual REXX for Presentation Manager
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. (C) COPYRIGHT IBM CORP.  1992
  137.  
  138.  
  139. CONTENTS
  140. ________
  141.  
  142.  
  143.  
  144.  
  145.  
  146.                     INTRODUCTION   . . . . . . . . . . . . . . . . . . . .  1
  147.                     System Requirements  . . . . . . . . . . . . . . . . .  2
  148.                     Installation   . . . . . . . . . . . . . . . . . . . .  2
  149.  
  150.                     USING VREXX  . . . . . . . . . . . . . . . . . . . . .  3
  151.  
  152.                     COMMAND LIST   . . . . . . . . . . . . . . . . . . . .  7
  153.  
  154.                     COMMAND REFERENCE  . . . . . . . . . . . . . . . . .   11
  155.                     VArc   . . . . . . . . . . . . . . . . . . . . . . .   12
  156.                     VBackColor   . . . . . . . . . . . . . . . . . . . .   13
  157.                     VCheckBox  . . . . . . . . . . . . . . . . . . . . .   13
  158.                     VClearWindow   . . . . . . . . . . . . . . . . . . .   14
  159.                     VCloseWindow   . . . . . . . . . . . . . . . . . . .   15
  160.                     VColorBox  . . . . . . . . . . . . . . . . . . . . .   15
  161.                     VDialogPos   . . . . . . . . . . . . . . . . . . . .   16
  162.                     VDraw  . . . . . . . . . . . . . . . . . . . . . . .   16
  163.                     VDrawParms   . . . . . . . . . . . . . . . . . . . .   18
  164.                     VExit  . . . . . . . . . . . . . . . . . . . . . . .   19
  165.                     VFileBox   . . . . . . . . . . . . . . . . . . . . .   20
  166.                     VFontBox   . . . . . . . . . . . . . . . . . . . . .   21
  167.                     VForeColor   . . . . . . . . . . . . . . . . . . . .   22
  168.                     VGetVersion  . . . . . . . . . . . . . . . . . . . .   22
  169.                     VInit  . . . . . . . . . . . . . . . . . . . . . . .   23
  170.                     VInputBox  . . . . . . . . . . . . . . . . . . . . .   24
  171.                     VListBox   . . . . . . . . . . . . . . . . . . . . .   25
  172.                     VMsgBox  . . . . . . . . . . . . . . . . . . . . . .   26
  173.                     VMultBox   . . . . . . . . . . . . . . . . . . . . .   26
  174.                     VOpenWindow  . . . . . . . . . . . . . . . . . . . .   28
  175.                     VRadioBox  . . . . . . . . . . . . . . . . . . . . .   29
  176.                     VResize  . . . . . . . . . . . . . . . . . . . . . .   30
  177.                     VSay   . . . . . . . . . . . . . . . . . . . . . . .   31
  178.                     VSetFont   . . . . . . . . . . . . . . . . . . . . .   32
  179.                     VSetTitle  . . . . . . . . . . . . . . . . . . . . .   33
  180.                     VTableBox  . . . . . . . . . . . . . . . . . . . . .   33
  181.  
  182.                     EXAMPLE VREXX PROCEDURES   . . . . . . . . . . . . .   37
  183.                     TESTWIN.CMD  . . . . . . . . . . . . . . . . . . . .   37
  184.                     TESTDLGS.CMD   . . . . . . . . . . . . . . . . . . .   40
  185.                     TESTDRAW.CMD   . . . . . . . . . . . . . . . . . . .   44
  186.  
  187.                     TECHNICAL DATA   . . . . . . . . . . . . . . . . . .   49
  188.  
  189.                     RELEASE NOTES AND COMMENTS   . . . . . . . . . . . .   51
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                                                                 Contents  iii
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.                                                 (C) COPYRIGHT IBM CORP.  1992
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. iv  VREXX:  Visual REXX for Presentation Manager
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269. (C) COPYRIGHT IBM CORP.  1992
  270.  
  271.  
  272. INTRODUCTION
  273. ____________
  274.  
  275.  
  276.  
  277.  
  278.  
  279.                     VREXX is Visual REXX - a new way for OS/2 users to create
  280.                     their own Presentation Manager (PM) programs using REXX!
  281.                     VREXX provides users with a set of functions that can be
  282.                     called from REXX procedures.  These functions open and
  283.                     close standard PM windows, providing programmable control
  284.                     over the appearance and positioning of the windows.
  285.                     Dialog box functions allow file selection, display of
  286.                     messages, entering numbers or text strings, and making
  287.                     single or multiple selections through radiobutton,
  288.                     checkbox or listbox controls.  Table, Color and font
  289.                     selection dialogs are also available.  And, graphics
  290.                     functions for setting pixels, drawing markers, lines,
  291.                     polygons, splines, arcs, circles and text (in multiple
  292.                     fonts) are included.
  293.  
  294.                     With VREXX, OS/2 REXX procedures can use all of the
  295.                     standard features of REXX under OS/2, except that the old
  296.                     text window input and output procedures are replaced with
  297.                     PM windows and dialogs.  No prior experience with PM pro-
  298.                     gramming is necessary.  The OS/2 Programming toolkit is
  299.                     NOT required.  All you need to do is write a REXX program
  300.                     that makes function calls to the VREXX functions.
  301.  
  302.                     VREXX features:
  303.  
  304.                     o   Creation and manipulation of standard PM windows
  305.  
  306.                     o   Powerful dialog functions, including:
  307.  
  308.                         -   Positioning control over the dialogs
  309.  
  310.                         -   Dialog button selections
  311.  
  312.                         -   Standard filename selection dialog
  313.  
  314.                         -   Data Table, Color selection and Font selection
  315.                             dialogs
  316.  
  317.                         -   10 line message box
  318.  
  319.                         -   Input boxes for entering text or numbers
  320.  
  321.                         -   Radiobutton, checkbox and listbox controls for
  322.                             selecting item(s) from a list
  323.  
  324.                     o   Graphics support, with functions for:
  325.  
  326.                         -   Setting window foreground and background colors
  327.  
  328.  
  329.                                                               INTRODUCTION  1
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.                                                 (C) COPYRIGHT IBM CORP.  1992
  337.  
  338.  
  339.                         -   Setting individual pixels
  340.  
  341.                         -   Drawing markers, with 10 different marker types
  342.  
  343.                         -   Polylines, with 7 different line types
  344.  
  345.                         -   Filled polygons, with 6 different fill types
  346.  
  347.                         -   Splines
  348.  
  349.                         -   Arcs and circles
  350.  
  351.                     o   On-line help facility
  352.  
  353.  
  354. SYSTEM REQUIREMENTS
  355. ___________________
  356.  
  357.                     VREXX runs under OS/2 PM version 2.0 on IBM PS/2 or PC-
  358.                     compatible systems.
  359.  
  360.  
  361. INSTALLATION
  362. ____________
  363.  
  364.                     Copy VREXX.INF to a BOOKSHELF help file directory speci-
  365.                     fied in your CONFIG.SYS file.  Copy VREXX.EXE and the
  366.                     sample command files to a utility directory included in
  367.                     your PATH statement.  Copy VREXX.DLL and DEVBASE.DLL to a
  368.                     directory specified in your LIBPATH in CONFIG.SYS.
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397. 2  VREXX:  Visual REXX for Presentation Manager
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404. (C) COPYRIGHT IBM CORP.  1992
  405.  
  406.  
  407. USING VREXX
  408. ___________
  409.  
  410.  
  411.  
  412.  
  413.  
  414.                     REXX procedures that call VREXX functions are started
  415.                     normally, by either typing the CMD filename on an OS/2
  416.                     command line, or by using the OS/2 START command.
  417.  
  418.                     To run a REXX procedure named EXAMPLE.CMD which calls
  419.                     VREXX functions, simply type:
  420.  
  421.                       example
  422.  
  423.                     or
  424.  
  425.                       start example.cmd
  426.  
  427.                     from an OS/2 command line prompt.  The EXAMPLE.CMD proce-
  428.                     dure will then execute normally, in addition to providing
  429.                     access to the VREXX functions.  To access on-line help
  430.                     for VREXX, use the OS/2 VIEW command by typing:
  431.  
  432.                       view vrexx.inf
  433.  
  434.                     or
  435.  
  436.                       vrexx
  437.  
  438.                     from an OS/2 command line prompt.
  439.  
  440.                     Before calling VREXX functions in your REXX procedures,
  441.                     you must load and initialize the external functions by
  442.                     calling VInit.  Also, the VExit function must be called
  443.                     at the end of your REXX procedure to clean up the system
  444.                     resources allocated in the initialization.  The recom-
  445.                     mended approach for this is to structure your REXX proce-
  446.                     dure as follows:
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.                                                                USING VREXX  3
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.                                                 (C) COPYRIGHT IBM CORP.  1992
  472.  
  473.  
  474.                       /* EXAMPLE.CMD - structure for initializing and */
  475.                       /*               terminating VREXX procedures   */
  476.  
  477.                       /* initialize VREXX */
  478.  
  479.                       '@echo off'
  480.                       call RxFuncAdd 'VInit', 'VREXX', 'VINIT'
  481.                       initcode = VInit()
  482.                       if initcode = 'ERROR' then signal CLEANUP
  483.  
  484.                       signal on failure name CLEANUP
  485.                       signal on halt name CLEANUP
  486.                       signal on syntax name CLEANUP
  487.  
  488.                       /* REXX statements and VREXX function calls go here */
  489.                       /* ...                                              */
  490.                       /* end of REXX statements                           */
  491.  
  492.                       /* terminate VREXX - add any other clean-up */
  493.                       /* for your REXX procedure here also        */
  494.  
  495.                       CLEANUP:
  496.                          call VExit
  497.  
  498.                       exit
  499.  
  500.                     The SIGNAL statements ensure that VExit is called if your
  501.                     REXX procedure contains an error.  You may optionally add
  502.                     a SIGNAL ON ERROR NAME CLEANUP statement also, depending
  503.                     on whether you provide another error handler for non-
  504.                     fatal ERROR return codes.
  505.  
  506.                     After initialization, VREXX lets you create multiple
  507.                     windows, with each window returning a specific id that
  508.                     you use to refer to the window for later operations.
  509.                     Note for PM programmers:  the REXX command files are pro-
  510.                     cedural, not event-driven.  Therefore, your REXX proce-
  511.                     dure executes from top to bottom as a normal REXX
  512.                     program.  But, at any time, especially when dialogs are
  513.                     displayed, the windows created with VREXX calls can be
  514.                     manipulated just like other PM windows - they may be
  515.                     iconized, resized, moved, etc.  Also, the contents of the
  516.                     window are maintained internally - you don't need to
  517.                     redraw the window every time it is moved or sized.  The
  518.                     windows are destroyed by calling a window close function,
  519.                     passing it the id of the window to close.
  520.  
  521.                     Although multiple windows may be created, only 1 dialog
  522.                     box at a time may be processed by the running REXX proce-
  523.                     dure.
  524.  
  525.                     Graphics coordinates for the windows are always set from
  526.                     0 to 1000 in both the x and y directions, with the origin
  527.  
  528.  
  529.  
  530. 4  VREXX:  Visual REXX for Presentation Manager
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537. (C) COPYRIGHT IBM CORP.  1992
  538.  
  539.  
  540.                     at the lower left corner of the window.  The current
  541.                     color and line type apply to all graphics operations.
  542.  
  543.                     The window and dialog positioning functions always
  544.                     operate with numbers representing a percentage of the
  545.                     screen.  Thus, to center a window on the screen with the
  546.                     window filling half of the screen area, the left and
  547.                     bottom corners of the window are set to 25, while the
  548.                     right and top corners of the window are set to 75.  See
  549.                     the command reference section for more examples on
  550.                     graphics and window positioning.
  551.  
  552.                     There are three sample REXX programs that come with the
  553.                     package, called TESTWIN.CMD, TESTDLGS.CMD, and
  554.                     TESTDRAW.CMD, which demonstrate the syntax of the VREXX
  555.                     functions.  The next two sections are a summary of these
  556.                     functions and a function reference, including notes on
  557.                     the syntax and arguments for VREXX functions.
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.                                                                USING VREXX  5
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.                                                 (C) COPYRIGHT IBM CORP.  1992
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662. 6  VREXX:  Visual REXX for Presentation Manager
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669. (C) COPYRIGHT IBM CORP.  1992
  670.  
  671.  
  672. COMMAND LIST
  673. ____________
  674.  
  675.  
  676.  
  677.  
  678.  
  679.                     This section provides a summary of the functions which
  680.                     can be called from a REXX procedure running under VREXX.
  681.                     See the EXAMPLES section for some REXX procedures which
  682.                     implement the VREXX commands.
  683.  
  684.                     The following functions are provided:
  685.  
  686.                     o   Startup, Termination and Version Functions
  687.  
  688.                         VEXIT               Cleans up the current VREXX
  689.                                             system resources
  690.  
  691.                         VGETVERSION         Returns the current VREXX program
  692.                                             version number
  693.  
  694.                         VINIT               Initializes the VREXX functions
  695.                                             and system resources
  696.  
  697.                     o   Window Functions
  698.  
  699.                         VBACKCOLOR          Sets the background color of a
  700.                                             window
  701.  
  702.                         VCLEARWINDOW        Clears the contents of a window
  703.  
  704.                         VCLOSEWINDOW        Closes a window
  705.  
  706.                         VFORECOLOR          Sets the foreground color of a
  707.                                             window
  708.  
  709.                         VOPENWINDOW         Opens a new window
  710.  
  711.                         VRESIZE             Resizes and repositions a window
  712.                                             on the screen
  713.  
  714.                         VSETTITLE           Sets the titlebar of a window to
  715.                                             a specified string
  716.  
  717.                     o   Dialog Functions
  718.  
  719.                         VCHECKBOX           Creates a checkbox dialog for
  720.                                             selecting multiple items from a
  721.                                             list
  722.  
  723.                         VCOLORBOX           Allows selection of foreground
  724.                                             and background colors from a
  725.                                             dialog
  726.  
  727.  
  728.  
  729.                                                               COMMAND LIST  7
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.                                                 (C) COPYRIGHT IBM CORP.  1992
  737.  
  738.  
  739.                         VDIALOGPOS          Controls the positioning of
  740.                                             dialog windows on the screen
  741.  
  742.                         VFILEBOX            Allows selection of a full
  743.                                             pathname of a file from a dialog
  744.  
  745.                         VFONTBOX            Allows selection of the typeface
  746.                                             and point size to use for text
  747.                                             output
  748.  
  749.                         VINPUTBOX           Creates an entryfield dialog with
  750.                                             prompt strings for entering
  751.                                             numbers or strings
  752.  
  753.                         VLISTBOX            Creates a listbox dialog for
  754.                                             selecting 1 item from a large
  755.                                             list
  756.  
  757.                         VMSGBOX             Creates a message box for dis-
  758.                                             playing from 1 to 10 message
  759.                                             strings
  760.  
  761.                         VMULTBOX            Creates a multiple entryfield
  762.                                             dialog, with 1 to 10 entryfields
  763.                                             and a prompt string for each
  764.                                             field, with optional echoing of
  765.                                             input characters (e.g. for
  766.                                             entering passwords).
  767.  
  768.                         VRADIOBOX           Creates a radiobox dialog for
  769.                                             selecting 1 item from a list
  770.  
  771.                         VTABLEBOX           Constructs a table dialog as a
  772.                                             listbox, with programmable column
  773.                                             widths
  774.  
  775.                     o   Graphics Functions
  776.  
  777.                         VARC                Draws an arc or complete circle,
  778.                                             optionally filled with the
  779.                                             current fill style
  780.  
  781.                         VDRAW               Draws pixels, markers, lines,
  782.                                             polygons or splines using the
  783.                                             current marker type, line attri-
  784.                                             bute and fill style
  785.  
  786.                         VDRAWPARMS          Sets the current marker type,
  787.                                             line attribute and fill style to
  788.                                             use for subsequent graphics oper-
  789.                                             ations
  790.  
  791.  
  792.  
  793.  
  794.  
  795. 8  VREXX:  Visual REXX for Presentation Manager
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802. (C) COPYRIGHT IBM CORP.  1992
  803.  
  804.  
  805.                         VSAY                Draws a text string in the
  806.                                             current font on a window
  807.  
  808.                         VSETFONT            Sets the current font to use for
  809.                                             drawing text
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.                                                               COMMAND LIST  9
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.                                                 (C) COPYRIGHT IBM CORP.  1992
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927. 10  VREXX:  Visual REXX for Presentation Manager
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934. (C) COPYRIGHT IBM CORP.  1992
  935.  
  936.  
  937. COMMAND REFERENCE
  938. _________________
  939.  
  940.  
  941.  
  942.  
  943.  
  944.                     This is an alphabetical list of the VREXX functions.  The
  945.                     calling arguments are described, and implementation
  946.                     limits and notes on each function are given.
  947.  
  948.                     For the dialog functions, several of them take a [stem]
  949.                     variable name as an argument.  For example, the VMsgBox
  950.                     function is called as follows:
  951.  
  952.                       msg.0 = 2
  953.                       msg.1 = 'This is the first line'
  954.                       msg.2 = 'This is the second line'
  955.  
  956.                       buttons = 1
  957.  
  958.                       call VMsgBox 'Dialog title', msg, buttons
  959.  
  960.                     where msg is the variable name of a stem variable.  This
  961.                     variable uses the same format for all dialog functions,
  962.                     where the stem.0 variable holds the number of items, and
  963.                     stem.1 through stem.n hold the actual items.  In the
  964.                     example above, there are 2 message lines to be displayed,
  965.                     so msg.0 is set to 2, and msg.1 and msg.2 hold the actual
  966.                     lines that will be displayed by the function.
  967.  
  968.                     The dialogs also take a standard [buttons] argument,
  969.                     which is defined as a number between 1 and 6, denoting
  970.                     that the following buttons be created on the dialog:
  971.  
  972.                       [buttons] value     Buttons created     Return value
  973.                       _______________     _______________     ____________
  974.  
  975.                              1            OK                  'OK'
  976.                              2            Cancel              'CANCEL'
  977.                              3            OK and Cancel       'OK' or 'CANCEL'
  978.                              4            Yes                 'YES'
  979.                              5            No                  'NO'
  980.                              6            Yes and No          'YES' or 'NO'
  981.  
  982.                     In the example above, the [buttons] argument to the
  983.                     VMsgBox function was 1, so the message box dialog would
  984.                     be created with a single pushbutton labelled "OK".  The
  985.                     VMsgBox function could also be called with the syntax:
  986.  
  987.                       return_button = VMsgBox('Dialog title', msg, buttons)
  988.  
  989.                     where the return_button variable would be set to the
  990.                     return value corresponding to the pushbutton selected by
  991.                     the user (return_value = 'OK' in this example).
  992.  
  993.  
  994.                                                         COMMAND REFERENCE  11
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.                                                 (C) COPYRIGHT IBM CORP.  1992
  1002.  
  1003.  
  1004.                     Those dialogs which need to return a selected string will
  1005.                     place the selected string in a [stem].vstring variable.
  1006.                     For example, to access the string typed into an
  1007.                     entryfield with the VInputBox function, use the following
  1008.                     code:
  1009.  
  1010.                       str.0 = 1
  1011.                       str.1 = 'Type a string'
  1012.                       call VInputBox 'Example', str, 1
  1013.  
  1014.                       answer = str.vstring
  1015.  
  1016.                       /* answer now contains the user input */
  1017.  
  1018.  
  1019. VARC
  1020. ____
  1021.  
  1022.                     PURPOSE             Draws an arc or complete circle,
  1023.                                         optionally filled with the current
  1024.                                         fill style
  1025.  
  1026.                     DEFINITION
  1027.  
  1028.                                           VARC [ID] [X] [Y] [RADIUS] [ANGLE1] [ANGLE2]
  1029.  
  1030.                     PARAMETERS          [id] is the window id.  [x] and [y]
  1031.                                         are the center point of the arc, and
  1032.                                         [radius] is the radius of the arc, in
  1033.                                         units of 0 to 1000.  [angle1] and
  1034.                                         [angle2] are the angles to draw the
  1035.                                         arc between, starting with angle 0 at
  1036.                                         3 o'clock, increasing in a counter-
  1037.                                         clockwise direction.
  1038.  
  1039.                     COMMENTS            [angle1] should be less than [angle2]
  1040.                                         and both angles should be between 0
  1041.                                         and 360 degrees.  The angles may be
  1042.                                         specified in floating point format.
  1043.  
  1044.                     FUNCTION RESULT     none
  1045.  
  1046.                     Example:
  1047.  
  1048.                       /* draw an arc in the center of a window, going
  1049.                          from 12 o'clock to 6 o'clock, with a radius of
  1050.                          100 */
  1051.  
  1052.                       a1 = 90
  1053.                       a1 = 270.0
  1054.                       call VArc id, 500, 500, 100, a1, a2
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061. 12  VREXX:  Visual REXX for Presentation Manager
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068. (C) COPYRIGHT IBM CORP.  1992
  1069.  
  1070.  
  1071. VBACKCOLOR
  1072. __________
  1073.  
  1074.                     PURPOSE             Sets the background color of a window
  1075.  
  1076.                     DEFINITION
  1077.  
  1078.                                           VBACKCOLOR [ID] [COLOR]
  1079.  
  1080.                     PARAMETERS          [id] is the window id and [color] is
  1081.                                         the new background color to use for
  1082.                                         the window.
  1083.  
  1084.                     COMMENTS            [color] must be specified as a
  1085.                                         string, in either upper, lower or
  1086.                                         mixed case, and must equal one of
  1087.                                         'BLACK', 'WHITE', 'RED', 'GREEN',
  1088.                                         'BLUE', 'CYAN', 'YELLOW' or 'PINK'.
  1089.  
  1090.                     FUNCTION RESULT     none
  1091.  
  1092.                     Example:
  1093.  
  1094.                       /* change a window background color to 'RED' */
  1095.  
  1096.                       call VBackColor id, 'RED'
  1097.  
  1098.  
  1099. VCHECKBOX
  1100. _________
  1101.  
  1102.                     PURPOSE             Creates a checkbox dialog for
  1103.                                         selecting multiple items from a list
  1104.  
  1105.                     DEFINITION
  1106.  
  1107.                                           VCHECKBOX [TITLE] [STEM] [OUTPUT] [BUTTONS]
  1108.  
  1109.                     PARAMETERS          [title] is the string to use for the
  1110.                                         dialog titlebar, and [stem] is the
  1111.                                         variable name of the stem variable
  1112.                                         containing the items that will be
  1113.                                         used in constructing the dialog.
  1114.                                         [output] is the variable name of the
  1115.                                         stem variable where the selected
  1116.                                         items will be placed, and [buttons]
  1117.                                         denotes the desired button types to
  1118.                                         be placed on the dialog.
  1119.  
  1120.                     COMMENTS            A maximum of 10 items may be passed
  1121.                                         to this function.  The [output] stem
  1122.                                         variable need not exist when this
  1123.                                         function is called.  The number of
  1124.                                         items selected is given by the
  1125.                                         [output].0 variable name (e.g. if
  1126.                                         [output] = user_selection, then the
  1127.  
  1128.  
  1129.                                                         COMMAND REFERENCE  13
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.                                                 (C) COPYRIGHT IBM CORP.  1992
  1137.  
  1138.  
  1139.                                         REXX variable user_selection.0 holds
  1140.                                         the number of items checked in the
  1141.                                         dialog, and user_selection.1 through
  1142.                                         user_selection.n hold the actual
  1143.                                         selections).  The [output] variable
  1144.                                         can be initialized before calling
  1145.                                         this function with the default
  1146.                                         strings to be checked when the dialog
  1147.                                         is created.
  1148.  
  1149.                     FUNCTION RESULT     'OK', 'CANCEL', 'YES' or 'NO',
  1150.                                         depending on the [buttons] argument
  1151.  
  1152.                     Example:
  1153.  
  1154.                       /* let user select movies */
  1155.  
  1156.                       movie.0 = 5
  1157.                       movie.1 = 'Silence of the Lambs'
  1158.                       movie.2 = 'Dr. Strangelove'
  1159.                       movie.3 = 'Terminator 2'
  1160.                       movie.4 = 'Goldfinger'
  1161.                       movie.5 = 'Basic Instinct'
  1162.  
  1163.                       button = VCheckBox('Select movies', movie, selection, 3)
  1164.                       if button = 'OK' then do
  1165.                          call VMsgBox('Your selections', selection, 1)
  1166.                       end
  1167.  
  1168.  
  1169. VCLEARWINDOW
  1170. ____________
  1171.  
  1172.                     PURPOSE             Clears the contents of a window
  1173.  
  1174.                     DEFINITION
  1175.  
  1176.                                           VCLEARWINDOW [ID]
  1177.  
  1178.                     PARAMETERS          [id] is the id of the window to
  1179.                                         clear.
  1180.  
  1181.                     COMMENTS            This function erases all graphics
  1182.                                         from a window, enabling you to start
  1183.                                         over with a new set of graphics com-
  1184.                                         mands.
  1185.  
  1186.                     FUNCTION RESULT     none
  1187.  
  1188.                     Example:
  1189.  
  1190.                       /* clear a window of all graphics */
  1191.  
  1192.                       call VClearWindow id
  1193.  
  1194.  
  1195.  
  1196. 14  VREXX:  Visual REXX for Presentation Manager
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203. (C) COPYRIGHT IBM CORP.  1992
  1204.  
  1205.  
  1206. VCLOSEWINDOW
  1207. ____________
  1208.  
  1209.                     PURPOSE             Closes a window
  1210.  
  1211.                     DEFINITION
  1212.  
  1213.                                           VCLOSEWINDOW [ID]
  1214.  
  1215.                     PARAMETERS          [id] is the id of the window you wish
  1216.                                         to close.
  1217.  
  1218.                     COMMENTS            The window must have been opened with
  1219.                                         a call to VOpenWindow.
  1220.  
  1221.                     FUNCTION RESULT     none
  1222.  
  1223.                     Example:
  1224.  
  1225.                       /* close a window */
  1226.  
  1227.                       call VCloseWindow id
  1228.  
  1229.  
  1230. VCOLORBOX
  1231. _________
  1232.  
  1233.                     PURPOSE             Allows selection of foreground and
  1234.                                         background colors from a dialog
  1235.  
  1236.                     DEFINITION
  1237.  
  1238.                                           VCOLORBOX [STEM]
  1239.  
  1240.                     PARAMETERS          [stem] is the name of a stem variable
  1241.                                         which holds the .fore and .back color
  1242.                                         values for the foreground and back-
  1243.                                         ground colors.
  1244.  
  1245.                     COMMENTS            The colors should be specified as one
  1246.                                         of 'BLACK', 'WHITE', 'RED', 'GREEN',
  1247.                                         'BLUE', 'CYAN', 'YELLOW' or 'PINK'.
  1248.  
  1249.                     FUNCTION RESULT     'OK' or 'CANCEL'
  1250.  
  1251.                     Example:
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.                                                         COMMAND REFERENCE  15
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.                                                 (C) COPYRIGHT IBM CORP.  1992
  1272.  
  1273.  
  1274.                       /* get new foreground and background colors for a
  1275.                          window and set them */
  1276.  
  1277.                       color.fore = 'BLACK'
  1278.                       color.back = 'WHITE'
  1279.                       button = VColorBox color
  1280.  
  1281.                       if button = 'OK' then do
  1282.                          call VForeColor color.fore
  1283.                          call VBackColor color.back
  1284.                       end
  1285.  
  1286.  
  1287. VDIALOGPOS
  1288. __________
  1289.  
  1290.                     PURPOSE             Controls the positioning of dialog
  1291.                                         windows on the screen
  1292.  
  1293.                     DEFINITION
  1294.  
  1295.                                           VDIALOGPOS [X] [Y]
  1296.  
  1297.                     PARAMETERS          [x] and [y] are the center position
  1298.                                         to use for positioning subsequent
  1299.                                         dialog boxes on the screen.
  1300.  
  1301.                     COMMENTS            [x] and [y] should be integers
  1302.                                         between 0 and 100, specified in per-
  1303.                                         centage of the screen.
  1304.  
  1305.                     FUNCTION RESULT     none
  1306.  
  1307.                     Example:
  1308.  
  1309.                       /* position a message box in the center of the screen */
  1310.  
  1311.                       call VDialogPos 50, 50
  1312.  
  1313.                       msg.0 = 1
  1314.                       msg.1 = 'This box is in the center of the screen'
  1315.                       call VMsgBox 'TEST', msg, 1
  1316.  
  1317.  
  1318. VDRAW
  1319. _____
  1320.  
  1321.                     PURPOSE             Draws pixels, markers, lines,
  1322.                                         polygons or splines using the current
  1323.                                         marker type, line attribute and fill
  1324.                                         style
  1325.  
  1326.                     DEFINITION
  1327.  
  1328.                                           VDRAW [ID] [DRAWTYPE] [XSTEM] [YSTEM] [NUM]
  1329.  
  1330.  
  1331.  
  1332. 16  VREXX:  Visual REXX for Presentation Manager
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339. (C) COPYRIGHT IBM CORP.  1992
  1340.  
  1341.  
  1342.                     PARAMETERS          [id] is the id of the window to use
  1343.                                         for drawing the graphics.  [drawtype]
  1344.                                         is a string, which must be one of
  1345.                                         'PIXEL', 'MARKER', 'LINE', 'POLYGON'
  1346.                                         or 'SPLINE', depending on the graphic
  1347.                                         to be drawn.  [xstem] and [ystem] are
  1348.                                         variable names for stem variables,
  1349.                                         which contain the coordinates to be
  1350.                                         used for drawing the graphics
  1351.                                         (ranging from .1 to .n).  [num] is
  1352.                                         the number of data points specified
  1353.                                         in the [xstem] and [ystem] variables.
  1354.  
  1355.                     COMMENTS            The coordinates should range between
  1356.                                         0 and 1000.  The drawtypes and their
  1357.                                         effects are:
  1358.  
  1359.                                         o   'PIXEL' sets a pixel in the fore-
  1360.                                             ground color for each point
  1361.  
  1362.                                         o   'MARKER' draws a marker at each
  1363.                                             point using the current marker
  1364.                                             type
  1365.  
  1366.                                         o   'LINE' draws a polyline con-
  1367.                                             necting all of the points using
  1368.                                             the current line attribute
  1369.  
  1370.                                         o   'POLYGON' draws a closed figure
  1371.                                             using the coordinates as
  1372.                                             vertices, filling the figure with
  1373.                                             the current fill type
  1374.  
  1375.                                         o   'SPLINE' requires 4 data points,
  1376.                                             and draws a Bezier cubic spline
  1377.                                             that passes through points 1 and
  1378.                                             4, using points 2 and 3 as
  1379.                                             control points.
  1380.  
  1381.                     FUNCTION RESULT     none
  1382.  
  1383.                     Example:
  1384.  
  1385.                       /* see the TESTDRAW.CMD procedure for examples of
  1386.                          using this function */
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.                                                         COMMAND REFERENCE  17
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.                                                 (C) COPYRIGHT IBM CORP.  1992
  1406.  
  1407.  
  1408. VDRAWPARMS
  1409. __________
  1410.  
  1411.                     PURPOSE             Sets the current marker type, line
  1412.                                         attribute and fill style to use for
  1413.                                         subsequent graphics operations
  1414.  
  1415.                     DEFINITION
  1416.  
  1417.                                           VDRAWPARMS [ID] [MARKERTYPE] [LINETYPE] [FILLTYPE]
  1418.  
  1419.                     PARAMETERS          [id] is the window id.  [markertype]
  1420.                                         is the marker type to draw,
  1421.                                         [linetype] is the line attribute to
  1422.                                         use, and [filltype] is the fill style
  1423.                                         to use in subsequent VDraw oper-
  1424.                                         ations.
  1425.  
  1426.                     COMMENTS            0 is the default for all 3 attri-
  1427.                                         butes, equal to a cross marker, a
  1428.                                         solid line, or an empty fill style.
  1429.                                         The other values and their corre-
  1430.                                         sponding meanings are shown in the
  1431.                                         example.
  1432.  
  1433.                     FUNCTION RESULT     none
  1434.  
  1435.                     Example:
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465. 18  VREXX:  Visual REXX for Presentation Manager
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472. (C) COPYRIGHT IBM CORP.  1992
  1473.  
  1474.  
  1475.                       /* VDrawParms marker, line and fill values */
  1476.  
  1477.                       default = 0
  1478.  
  1479.                       /* marker types */
  1480.  
  1481.                       cross        = 1     /* X */
  1482.                       plus         = 2     /* + */
  1483.                       diamond      = 3     /* &diamond. */
  1484.                       square       = 4     /* [_] */
  1485.                       star6        = 5     /* 6 point star */
  1486.                       star8        = 6     /* 8 point star */
  1487.                       soliddiamond = 7     /* &DIAMOND. */
  1488.                       solidsquare  = 8     /* &sqbul. */
  1489.                       soliddot     = 9     /* . */
  1490.                       circle       = 10    /* O */
  1491.  
  1492.                       /* line types */
  1493.  
  1494.                       solid      = 0       /* ____  */
  1495.                       dot        = 1       /* ....  */
  1496.                       dash       = 2       /* ----  */
  1497.                       dashdot    = 3       /* -.-.  */
  1498.                       dotdot     = 4       /* .. .. */
  1499.                       longdash   = 5       /* __ __ */
  1500.                       dashdotdot = 6       /* -..-  */
  1501.  
  1502.                       /* set up fill types */
  1503.  
  1504.                       nofill    = 0        /*       */
  1505.                       solidfill = 1        /* &BOX. */
  1506.                       horz      = 2        /* ===== */
  1507.                       vert      = 3        /* ||||| */
  1508.                       leftdiag  = 4        /* \\\\\ */
  1509.                       rightdiag = 5        /* ///// */
  1510.  
  1511.                       /* sample function call */
  1512.  
  1513.                       call VDrawParms diamond, dotdot, leftdiag
  1514.  
  1515.  
  1516. VEXIT
  1517. _____
  1518.  
  1519.                     PURPOSE             Cleans up the current VREXX system
  1520.                                         resources
  1521.  
  1522.                     DEFINITION
  1523.  
  1524.                                           VEXIT
  1525.  
  1526.                     PARAMETERS          none
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.                                                         COMMAND REFERENCE  19
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.                                                 (C) COPYRIGHT IBM CORP.  1992
  1540.  
  1541.  
  1542.                     COMMENTS            This function should be called after
  1543.                                         all VREXX function calls in the
  1544.                                         current REXX procedure are made.
  1545.  
  1546.                     FUNCTION RESULT     none
  1547.  
  1548.                     Example:
  1549.  
  1550.                       /* terminate VREXX */
  1551.  
  1552.                       call VExit
  1553.  
  1554.  
  1555. VFILEBOX
  1556. ________
  1557.  
  1558.                     PURPOSE             Allows selection of a full pathname
  1559.                                         of a file from a dialog
  1560.  
  1561.                     DEFINITION
  1562.  
  1563.                                           VFILEBOX [TITLE] [TEMPLATE] [STEM]
  1564.  
  1565.                     PARAMETERS          [title] is the string to use for the
  1566.                                         dialog titlebar.  [template] is the
  1567.                                         pathname template that specifies the
  1568.                                         file types to display.  [stem] is the
  1569.                                         name of a stem variable that contains
  1570.                                         the full pathname of the selected
  1571.                                         file.
  1572.  
  1573.                     COMMENTS            If the name of the [stem] variable is
  1574.                                         fname, the full pathname is returned
  1575.                                         in the REXX variable fname.vstring.
  1576.  
  1577.                     FUNCTION RESULT     'OK' or 'CANCEL'
  1578.  
  1579.                     Example:
  1580.  
  1581.                       /* get a filename */
  1582.  
  1583.                       button = VFileBox('Pick a file', '*.dat', name)
  1584.                       if button = 'OK' then do
  1585.                          filename = name.vstring
  1586.  
  1587.                          /* get size of file */
  1588.  
  1589.                          bytes = stream(filename, C, 'query size')
  1590.                       end
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599. 20  VREXX:  Visual REXX for Presentation Manager
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606. (C) COPYRIGHT IBM CORP.  1992
  1607.  
  1608.  
  1609. VFONTBOX
  1610. ________
  1611.  
  1612.                     PURPOSE             Allows selection of the typeface and
  1613.                                         point size to use for text output
  1614.  
  1615.                     DEFINITION
  1616.  
  1617.                                           VFONTBOX [STEM]
  1618.  
  1619.                     PARAMETERS          [stem] is the name of a stem vari-
  1620.                                         able, with [stem].type and
  1621.                                         [stem].size containing the selected
  1622.                                         font type and font point size
  1623.                                         returned from the dialog box.
  1624.  
  1625.                     COMMENTS            The point size must be a positive
  1626.                                         integer greater than zero.  The font
  1627.                                         type must be one of the following
  1628.                                         strings:
  1629.  
  1630.                                         o   'SYSTEM' - standard system font
  1631.  
  1632.                                         o   'SYMBOL' - greek/math symbols
  1633.  
  1634.                                         o   'COUR' - Courier, Courier Bold,
  1635.                                             Courier Italic, Courier Bold
  1636.                                             Italic
  1637.  
  1638.                                         o   'COURB'
  1639.  
  1640.                                         o   'COURI'
  1641.  
  1642.                                         o   'COURBI'
  1643.  
  1644.                                         o   'HELV' - Helvetica, Helvetica
  1645.                                             Bold, Helvetica Italic, Helvetica
  1646.                                             Bold Italic
  1647.  
  1648.                                         o   'HELVB'
  1649.  
  1650.                                         o   'HELVI'
  1651.  
  1652.                                         o   'HELVBI'
  1653.  
  1654.                                         o   'TIME' - Times Roman, TR Bold, TR
  1655.                                             Italic, TR Bold Italic
  1656.  
  1657.                                         o   'TIMEB'
  1658.  
  1659.                                         o   'TIMEI'
  1660.  
  1661.                                         o   'TIMEBI'
  1662.  
  1663.                     FUNCTION RESULT     'OK' or 'CANCEL'
  1664.  
  1665.  
  1666.                                                         COMMAND REFERENCE  21
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.                                                 (C) COPYRIGHT IBM CORP.  1992
  1674.  
  1675.  
  1676.                     Example:
  1677.  
  1678.                       /* let user pick a new font */
  1679.  
  1680.                       cur_font.type = 'SYSTEM'
  1681.                       cur_font.size = 10
  1682.  
  1683.                       button = VFontBox(cur_font)
  1684.  
  1685.                       if button = 'OK' then do
  1686.                          call VSetFont id, cur_font.type, cur_font.size
  1687.                       end
  1688.  
  1689.  
  1690. VFORECOLOR
  1691. __________
  1692.  
  1693.                     PURPOSE
  1694.  
  1695.                     DEFINITION          Sets the foreground color of a window
  1696.  
  1697.                                           VFORECOLOR [ID] [COLOR]
  1698.  
  1699.                     PARAMETERS          [id] is the window id and [color] is
  1700.                                         the new foreground color to use for
  1701.                                         the window.
  1702.  
  1703.                     COMMENTS            [color] must be specified as a
  1704.                                         string, in either upper, lower or
  1705.                                         mixed case, and must equal one of
  1706.                                         'BLACK', 'WHITE', 'RED', 'GREEN',
  1707.                                         'BLUE', 'CYAN', 'YELLOW' or 'PINK'.
  1708.  
  1709.                     FUNCTION RESULT     none
  1710.  
  1711.                     Example:
  1712.  
  1713.                       /* change a window foreground color to 'PINK' */
  1714.  
  1715.                       call VForeColor id, 'PINK'
  1716.  
  1717.  
  1718. VGETVERSION
  1719. ___________
  1720.  
  1721.                     PURPOSE             Returns the current VREXX program
  1722.                                         version number
  1723.  
  1724.                     DEFINITION
  1725.  
  1726.                                           VGETVERSION
  1727.  
  1728.                     PARAMETERS          none
  1729.  
  1730.                     COMMENTS            none
  1731.  
  1732.  
  1733.  
  1734. 22  VREXX:  Visual REXX for Presentation Manager
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741. (C) COPYRIGHT IBM CORP.  1992
  1742.  
  1743.  
  1744.                     FUNCTION RESULT     Returns the version number as
  1745.                                         major.minor
  1746.  
  1747.                     Example:
  1748.  
  1749.                       /* test version of VREXX */
  1750.  
  1751.                       ver = VGetVersion()
  1752.  
  1753.                       if ver <> '2.1' then do
  1754.                          msg.0 = 1
  1755.                          msg.1 = 'Wrong version of VREXX'
  1756.  
  1757.                          call VMsgBox('Initialization Error', msg, 2)
  1758.                          exit
  1759.                       end
  1760.  
  1761.  
  1762. VINIT
  1763. _____
  1764.  
  1765.                     PURPOSE             Initializes the VREXX functions and
  1766.                                         system resources
  1767.  
  1768.                     DEFINITION
  1769.  
  1770.                                           VINIT
  1771.  
  1772.                     PARAMETERS          none
  1773.  
  1774.                     COMMENTS            This function must be called before
  1775.                                         calling any other VREXX functions.
  1776.                                         The VExit routine should be called at
  1777.                                         the end of the REXX procedure if
  1778.                                         VInit was called.
  1779.  
  1780.                     FUNCTION RESULT     Returns 'ERROR' if initialization was
  1781.                                         unsuccessful.
  1782.  
  1783.                     Example:
  1784.  
  1785.                       /* load and initialize VREXX (use the */
  1786.                       /* RxUtils function RxFuncAdd)        */
  1787.  
  1788.                       call RxFuncAdd 'VInit', 'VREXX', 'VINIT'
  1789.                       call VInit
  1790.  
  1791.                       /* or */
  1792.  
  1793.                       call RxFuncAdd 'VInit', 'VREXX', 'VINIT'
  1794.                       initcode = VInit()
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.                                                         COMMAND REFERENCE  23
  1802.  
  1803.  
  1804.  
  1805.  
  1806.  
  1807.  
  1808.                                                 (C) COPYRIGHT IBM CORP.  1992
  1809.  
  1810.  
  1811. VINPUTBOX
  1812. _________
  1813.  
  1814.                     PURPOSE             Creates an entryfield dialog with
  1815.                                         prompt strings for entering numbers
  1816.                                         or strings
  1817.  
  1818.                     DEFINITION
  1819.  
  1820.                                           VINPUTBOX [TITLE] [STEM] [WIDTH] [BUTTONS]
  1821.  
  1822.                     PARAMETERS          [title] is the string to use for the
  1823.                                         dialog titlebar.  [stem] is the name
  1824.                                         of the stem variable containing the
  1825.                                         prompt strings to display in the
  1826.                                         dialog, and [width] if the width (in
  1827.                                         character units) of the entryfield.
  1828.                                         [buttons] is a number between 1 and 6
  1829.                                         denoting the pushbuttons to display
  1830.                                         on the dialog.
  1831.  
  1832.                     COMMENTS            Up to 10 strings can be specified for
  1833.                                         a prompt, and all strings should be
  1834.                                         80 characters or less in length.  The
  1835.                                         [stem].vstring field may contain a
  1836.                                         default value for the entryfield on
  1837.                                         input, and holds the contents of the
  1838.                                         entryfield when the dialog is fin-
  1839.                                         ished.
  1840.  
  1841.                     FUNCTION RESULT     'OK', 'CANCEL', 'YES' or 'NO',
  1842.                                         depending on the value of [buttons]
  1843.  
  1844.                     Example:
  1845.  
  1846.                       /* get the user's name */
  1847.  
  1848.                       prompt.0 = 4
  1849.                       prompt.1 = 'Please enter your name'
  1850.                       prompt.2 = 'Enter it first name last, last name first'
  1851.                       prompt.3 = ''
  1852.                       prompt.4 = 'Leave out your middle initial'
  1853.  
  1854.                       prompt.vstring = 'Doe John'
  1855.  
  1856.                       button = VInputBox('Verify info', prompt, 25, 2)
  1857.  
  1858.                       if button = 'OK' then do
  1859.                          name = prompt.vstring
  1860.                       end
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868. 24  VREXX:  Visual REXX for Presentation Manager
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875. (C) COPYRIGHT IBM CORP.  1992
  1876.  
  1877.  
  1878. VLISTBOX
  1879. ________
  1880.  
  1881.                     PURPOSE             Creates a listbox dialog for
  1882.                                         selecting 1 item from a large list
  1883.  
  1884.                     DEFINITION
  1885.  
  1886.                                           VLISTBOX [TITLE] [STEM] [WIDTH] [HEIGHT] [BUTTONS]
  1887.  
  1888.                     PARAMETERS          [title] is the string to use for the
  1889.                                         dialog titlebar.  [stem] is the name
  1890.                                         of the stem variable which contains
  1891.                                         the number of items and text of each
  1892.                                         item to be placed in the listbox.
  1893.                                         [width] and [height] are the dimen-
  1894.                                         sions of the listbox in character
  1895.                                         units, and [buttons] is a number
  1896.                                         between 1 and 6 denoting the type of
  1897.                                         pushbuttons to display on the dialog.
  1898.  
  1899.                     COMMENTS            Any number of strings may be passed
  1900.                                         to this function.  On input,
  1901.                                         [stem].vstring may contain the
  1902.                                         default list item to be selected when
  1903.                                         the dialog is created.  If a default
  1904.                                         is not specified, the first item
  1905.                                         becomes the default selection.  On
  1906.                                         output, [stem].vstring contains the
  1907.                                         listbox item selected by the user.
  1908.  
  1909.                     FUNCTION RESULT     'OK', 'CANCEL', 'YES' or 'NO',
  1910.                                         depending on the value of [buttons]
  1911.  
  1912.                     Example:
  1913.  
  1914.                       /* select 1 item from a listbox */
  1915.  
  1916.                       clone.0 = 8
  1917.                       clone.1 = 'Northgate'
  1918.                       clone.2 = 'Everex'
  1919.                       clone.3 = 'Gateway'
  1920.                       clone.4 = 'PC Brand'
  1921.                       clone.5 = 'AST Research'
  1922.                       clone.6 = 'Tandy'
  1923.                       clone.7 = 'Swan'
  1924.                       clone.8 = 'Commodore'
  1925.  
  1926.                       call VListBox 'Pick an IBM PC clone', clone, 10, 5, 1
  1927.                       selection = clone.vstring
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.                                                         COMMAND REFERENCE  25
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.                                                 (C) COPYRIGHT IBM CORP.  1992
  1943.  
  1944.  
  1945. VMSGBOX
  1946. _______
  1947.  
  1948.                     PURPOSE             Creates a message box for displaying
  1949.                                         from 1 to 10 message strings
  1950.  
  1951.                     DEFINITION
  1952.  
  1953.                                           VMSGBOX [TITLE] [STEM] [BUTTONS]
  1954.  
  1955.                     PARAMETERS          [title] is the string to use for the
  1956.                                         dialog titlebar.  [stem] is the name
  1957.                                         of the stem variable which contains
  1958.                                         the number of message lines text of
  1959.                                         each line to be displayed.  [buttons]
  1960.                                         is a number between 1 and 6 denoting
  1961.                                         the type of pushbuttons to display on
  1962.                                         the dialog.
  1963.  
  1964.                     COMMENTS            Up to 10 lines of 80 characters each
  1965.                                         may be displayed.
  1966.  
  1967.                     FUNCTION RESULT     'OK', 'CANCEL', 'YES' or 'NO',
  1968.                                         depending on the value of [buttons]
  1969.  
  1970.                     Example:
  1971.  
  1972.                       /* display a message box */
  1973.  
  1974.                       mbox.0 = 4
  1975.                       mbox.1 = 'VREXX Version 1.0'
  1976.                       mbox.2 = ''
  1977.                       mbox.3 = 'Written by R.B. Lam'
  1978.                       mbox.4 = '(C) Copyright IBM Corp.  1992'
  1979.  
  1980.                       call VMsgBox 'VREXX Info', mbox, 1
  1981.  
  1982.  
  1983. VMULTBOX
  1984. ________
  1985.  
  1986.                     PURPOSE             Creates a multiple entryfield dialog,
  1987.                                         with 1 to 10 entryfields and a prompt
  1988.                                         string for each field, with optional
  1989.                                         echoing of input characters (e.g. for
  1990.                                         entering passwords).
  1991.  
  1992.                     DEFINITION
  1993.  
  1994.                                           VMULTBOX [TITLE] [PROMPT] [WIDTH] [HIDE] [RETURN] [BUTTONS]
  1995.  
  1996.                     PARAMETERS          [title] is the string to use for the
  1997.                                         dialog titlebar.  [prompt] is the
  1998.                                         name of the stem variable containing
  1999.                                         the prompt strings to display (1 for
  2000.                                         each entryfield) in the dialog, where
  2001.  
  2002.  
  2003. 26  VREXX:  Visual REXX for Presentation Manager
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010. (C) COPYRIGHT IBM CORP.  1992
  2011.  
  2012.  
  2013.                                         [prompt].0 is the number of
  2014.                                         entryfields.  [width] is an array of
  2015.                                         widths (in character units) to use,
  2016.                                         one for each entryfield.  [hide] is
  2017.                                         an array where the elements are 0 or
  2018.                                         1, depending on whether or not you
  2019.                                         wish to echo (0) or not echo (1) the
  2020.                                         characters as they are typed into the
  2021.                                         entryfield.  This is useful for
  2022.                                         entering passwords (see the example
  2023.                                         below).  [return] is the array of
  2024.                                         return strings, which represent what
  2025.                                         was typed into each entryfield.
  2026.                                         [return] may be initialized with
  2027.                                         default strings for each entryfield
  2028.                                         before this function is called.
  2029.                                         [buttons] is a number between 1 and 6
  2030.                                         denoting the pushbuttons to display
  2031.                                         on the dialog.
  2032.  
  2033.                     COMMENTS            Up to 10 strings can be specified for
  2034.                                         a prompt, and all strings should be
  2035.                                         80 characters or less in length.
  2036.  
  2037.                     FUNCTION RESULT     'OK', 'CANCEL', 'YES' or 'NO',
  2038.                                         depending on the value of [buttons]
  2039.  
  2040.                     Example:
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.                                                         COMMAND REFERENCE  27
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.                                                 (C) COPYRIGHT IBM CORP.  1992
  2077.  
  2078.  
  2079.                       /* get system, userid, and password */
  2080.  
  2081.                       /* here are the prompts */
  2082.  
  2083.                       p.0 = 3
  2084.                       p.1 = 'System name'
  2085.                       p.2 = 'User ID'
  2086.                       p.3 = 'Password'
  2087.  
  2088.                       /* here are the widths for each entryfield */
  2089.  
  2090.                       w.0 = p.0
  2091.                       w.1 = 20
  2092.                       w.2 = 10
  2093.                       w.3 = 8
  2094.  
  2095.                       /* don't echo the password field */
  2096.  
  2097.                       h.0 = p.0
  2098.                       h.1 = 0
  2099.                       h.2 = 0
  2100.                       h.3 = 1
  2101.  
  2102.                       /* default strings */
  2103.  
  2104.                       r.0 = p.0
  2105.                       r.1 = 'IBMVM'
  2106.                       r.2 = 'johndoe'
  2107.                       r.3 = ''
  2108.  
  2109.                       button = VMultBox('Logon Panel', p, w, h, r, 2)
  2110.  
  2111.                       if button = 'OK' then do
  2112.                          call VMsgBox 'Logon Info', r, 1
  2113.                       end
  2114.  
  2115.  
  2116. VOPENWINDOW
  2117. ___________
  2118.  
  2119.                     PURPOSE             Opens a new window
  2120.  
  2121.                     DEFINITION
  2122.  
  2123.                                           VOPENWINDOW [TITLE] [COLOR] [STEM]
  2124.  
  2125.                     PARAMETERS          [title] is the string to use for the
  2126.                                         window titlebar.  [color] is the
  2127.                                         background color to use for the
  2128.                                         window.  [stem] is the name of a stem
  2129.                                         variable which contains the position
  2130.                                         and size of the window when it it
  2131.                                         created.  There are 4 fields,
  2132.                                         [stem].left, [stem].right,
  2133.  
  2134.  
  2135.  
  2136. 28  VREXX:  Visual REXX for Presentation Manager
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143. (C) COPYRIGHT IBM CORP.  1992
  2144.  
  2145.  
  2146.                                         [stem].bottom and [stem].top, which
  2147.                                         must be specified.
  2148.  
  2149.                     COMMENTS            The left, right, top and bottom
  2150.                                         fields should be integer numbers
  2151.                                         representing a percentage of the
  2152.                                         screen, ranging between 0 and 100.
  2153.  
  2154.                     FUNCTION RESULT     Returns an integer id number used to
  2155.                                         refer to the new window in subsequent
  2156.                                         function calls
  2157.  
  2158.                     Example:
  2159.  
  2160.                       /* put up a new window in the upper left quadrant of
  2161.                          the screen, with a background of white */
  2162.  
  2163.                       pos.left   = 0
  2164.                       pos.bottom = 0
  2165.                       pos.right  = 50
  2166.                       pos.top    = 100
  2167.  
  2168.                       color = 'WHITE'
  2169.  
  2170.                       new_id = VOpenWindow('An example window', color, pos)
  2171.  
  2172.  
  2173. VRADIOBOX
  2174. _________
  2175.  
  2176.                     PURPOSE             Creates a radiobox dialog for
  2177.                                         selecting 1 item from a list
  2178.  
  2179.                     DEFINITION
  2180.  
  2181.                                           VRADIOBOX [TITLE] [STEM] [BUTTONS]
  2182.  
  2183.                     PARAMETERS          [title] is the string to use for the
  2184.                                         dialog titlebar.  [stem] is the name
  2185.                                         of the stem variable which contains
  2186.                                         the number of items and text of each
  2187.                                         item to be placed in the dialog.
  2188.                                         [buttons] is a number between 1 and 6
  2189.                                         denoting the type of pushbuttons to
  2190.                                         display on the dialog.
  2191.  
  2192.                     COMMENTS            A maximum of 10 items may be passed
  2193.                                         to this function.  On input,
  2194.                                         [stem].vstring can specify the
  2195.                                         default radio button to be pressed
  2196.                                         when the dialog is created.  If none
  2197.                                         is specified, the first item becomes
  2198.                                         the default. On output,
  2199.                                         [stem].vstring contains the item
  2200.                                         selected by the user.
  2201.  
  2202.  
  2203.                                                         COMMAND REFERENCE  29
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.                                                 (C) COPYRIGHT IBM CORP.  1992
  2211.  
  2212.  
  2213.                     FUNCTION RESULT     'OK', 'CANCEL', 'YES' or 'NO',
  2214.                                         depending on the value of [buttons]
  2215.  
  2216.                     Example:
  2217.  
  2218.                       /* have user select a font by pushing a radiobutton */
  2219.  
  2220.                       font.0 = 7
  2221.                       font.1 = 'Garamond'
  2222.                       font.2 = 'Helvetica'
  2223.                       font.3 = 'Times Italic'
  2224.                       font.4 = 'Weather'
  2225.                       font.5 = 'Math'
  2226.                       font.6 = 'Orator'
  2227.                       font.7 = 'Default'
  2228.  
  2229.                       call VRadioBox 'Select a font', font, 1
  2230.  
  2231.                       msg.0 = 1
  2232.                       msg.1 = 'You selected' font.vstring
  2233.  
  2234.                       call VMsgBox 'Selection', msg, 1
  2235.  
  2236.  
  2237. VRESIZE
  2238. _______
  2239.  
  2240.                     PURPOSE             Resizes and repositions a window on
  2241.                                         the screen
  2242.  
  2243.                     DEFINITION
  2244.  
  2245.                                           VRESIZE [ID] [STEM]
  2246.  
  2247.                     PARAMETERS          [id] is the id of the window to move
  2248.                                         and size.  [stem] is the name of a
  2249.                                         stem variable containing the new
  2250.                                         coordinates of the window in per-
  2251.                                         centage of screen units.  The size
  2252.                                         and position are given in
  2253.                                         [stem].left, [stem].right,
  2254.                                         [stem].bottom and [stem].top.
  2255.  
  2256.                     COMMENTS            The left, bottom, right and top coor-
  2257.                                         dinates should be integers between 0
  2258.                                         and 100.
  2259.  
  2260.                     FUNCTION RESULT     none
  2261.  
  2262.                     Example:
  2263.  
  2264.  
  2265.  
  2266.  
  2267.  
  2268.  
  2269.  
  2270. 30  VREXX:  Visual REXX for Presentation Manager
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277. (C) COPYRIGHT IBM CORP.  1992
  2278.  
  2279.  
  2280.                       /* create a small window in the center of the screen,
  2281.                          then move it to the lower right quadrant and
  2282.                          increase its size */
  2283.  
  2284.                       pos.left   = 40
  2285.                       pos.bottom = 40
  2286.                       pos.right  = 60
  2287.                       pos.top    = 60
  2288.                       id = VOpenWindow('Small window', 'WHITE', pos)
  2289.  
  2290.                       pos.left   = 50
  2291.                       pos.bottom = 0
  2292.                       pos.right  = 100
  2293.                       pos.top    = 50
  2294.                       call VResize id, pos
  2295.  
  2296.  
  2297. VSAY
  2298. ____
  2299.  
  2300.                     PURPOSE             Draws a text string in the current
  2301.                                         font on a window
  2302.  
  2303.                     DEFINITION
  2304.  
  2305.                                           VSAY [ID] [X] [Y] [TEXT]
  2306.  
  2307.                     PARAMETERS          [id] is the id of the window where
  2308.                                         the text will be drawn.  [x] and [y]
  2309.                                         are the starting coordinates for the
  2310.                                         text, expressed as integers between 0
  2311.                                         and 1000.  [text] is the text string
  2312.                                         to draw.
  2313.  
  2314.                     COMMENTS            The text will be drawn in the current
  2315.                                         font and the current color.
  2316.  
  2317.                     FUNCTION RESULT     none
  2318.  
  2319.                     Example:
  2320.  
  2321.                       /* draw a set of text strings */
  2322.  
  2323.                       str.1 = 'You will need:
  2324.                       str.2 = '*  C Compiler'
  2325.                       str.3 = '*  OS/2 Programmer's Reference'
  2326.  
  2327.                       x = 50
  2328.                       y = 900
  2329.                       do i = 1 to 3
  2330.                          call VSay id, x, y, str.i
  2331.                          y = y - 100
  2332.                       end
  2333.  
  2334.  
  2335.  
  2336.  
  2337.                                                         COMMAND REFERENCE  31
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.                                                 (C) COPYRIGHT IBM CORP.  1992
  2345.  
  2346.  
  2347. VSETFONT
  2348. ________
  2349.  
  2350.                     PURPOSE             Sets the current font to use for
  2351.                                         drawing text
  2352.  
  2353.                     DEFINITION
  2354.  
  2355.                                           VSETFONT [ID] [TYPE] [SIZE]
  2356.  
  2357.                     PARAMETERS          [id] is the id of the window.  [type]
  2358.                                         is a string representing the typeface
  2359.                                         requested, and [size] is the point
  2360.                                         size for the requested font.
  2361.  
  2362.                     COMMENTS            The point size must be a positive
  2363.                                         integer greater than zero.  The
  2364.                                         typeface must be one of the following
  2365.                                         strings:
  2366.  
  2367.                                         o   'SYSTEM' - standard system font
  2368.  
  2369.                                         o   'SYMBOL' - greek/math symbols
  2370.  
  2371.                                         o   'COUR' - Courier, Courier Bold,
  2372.                                             Courier Italic, Courier Bold
  2373.                                             Italic
  2374.  
  2375.                                         o   'COURB'
  2376.  
  2377.                                         o   'COURI'
  2378.  
  2379.                                         o   'COURBI'
  2380.  
  2381.                                         o   'HELV' - Helvetica, Helvetica
  2382.                                             Bold, Helvetica Italic, Helvetica
  2383.                                             Bold Italic
  2384.  
  2385.                                         o   'HELVB'
  2386.  
  2387.                                         o   'HELVI'
  2388.  
  2389.                                         o   'HELVBI'
  2390.  
  2391.                                         o   'TIME' - Times Roman, TR Bold, TR
  2392.                                             Italic, TR Bold Italic
  2393.  
  2394.                                         o   'TIMEB'
  2395.  
  2396.                                         o   'TIMEI'
  2397.  
  2398.                                         o   'TIMEBI'
  2399.  
  2400.                     FUNCTION RESULT     none
  2401.  
  2402.  
  2403.  
  2404. 32  VREXX:  Visual REXX for Presentation Manager
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411. (C) COPYRIGHT IBM CORP.  1992
  2412.  
  2413.  
  2414.                     Example:
  2415.  
  2416.                       /* set the font to 20 point Helvetica Bold */
  2417.  
  2418.                       call VSetFont id, 'HELVB', 20
  2419.  
  2420.  
  2421. VSETTITLE
  2422. _________
  2423.  
  2424.                     PURPOSE             Sets the titlebar of a window to a
  2425.                                         specified string
  2426.  
  2427.                     DEFINITION
  2428.  
  2429.                                           VSETTITLE [ID] [TITLE]
  2430.  
  2431.                     PARAMETERS          [id] is the id of the window, and
  2432.                                         [title] is the new string to use for
  2433.                                         the window's titlebar.
  2434.  
  2435.                     COMMENTS
  2436.  
  2437.                     FUNCTION RESULT     none
  2438.  
  2439.                     Example:
  2440.  
  2441.                       /* open a window with one title, then change it */
  2442.  
  2443.                       pos.left   = 25
  2444.                       pos.bottom = 25
  2445.                       pos.right  = 75
  2446.                       pos.top    = 75
  2447.  
  2448.                       id = VOpenWindow('Old Window Title', 'WHITE', pos)
  2449.  
  2450.                       call VSetTitle id, 'New Window Title'
  2451.  
  2452.  
  2453. VTABLEBOX
  2454. _________
  2455.  
  2456.                     PURPOSE             Constructs a table dialog as a
  2457.                                         listbox, with programmable column
  2458.                                         widths
  2459.  
  2460.                     DEFINITION
  2461.  
  2462.                                           VTABLEBOX [TITLE] [STEM] [SELECTION] [WIDTH] [HEIGHT] [BUTTONS]
  2463.  
  2464.                     PARAMETERS          [title] is the string to use for the
  2465.                                         dialog titlebar.  [stem] is the name
  2466.                                         of the stem variable which contains
  2467.                                         the number of rows and columns,
  2468.                                         column widths, column labels and text
  2469.                                         of each item to be placed in a table-
  2470.  
  2471.  
  2472.                                                         COMMAND REFERENCE  33
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.                                                 (C) COPYRIGHT IBM CORP.  1992
  2480.  
  2481.  
  2482.                                         style listbox.  [selection] contains
  2483.                                         the number of the table row to be
  2484.                                         selected when the dialog is created.
  2485.                                         [width] and [height] are the dimen-
  2486.                                         sions of the table in character
  2487.                                         units, and [buttons] is a number
  2488.                                         between 1 and 6 denoting the type of
  2489.                                         pushbuttons to display on the dialog.
  2490.  
  2491.                     COMMENTS            Any number of strings may be passed
  2492.                                         to this function, all with a maximum
  2493.                                         length of 80.  The number of columns
  2494.                                         in the table is limited to 10.  The
  2495.                                         number of rows and columns in the
  2496.                                         table are specified with the
  2497.                                         [stem].rows and [stem].cols vari-
  2498.                                         ables.  The column widths are speci-
  2499.                                         fied in [stem].width.1,
  2500.                                         [stem].width.2, etc.  The column
  2501.                                         labels are specified in
  2502.                                         [stem].label.1, [stem].label.2, etc.
  2503.                                         Finally, the entries for the table
  2504.                                         are stored in row-column order, with
  2505.                                         [stem].1.1 being the entry for row 1,
  2506.                                         column 1, [stem].1.2 being the entry
  2507.                                         for row 1, column 2, etc.  On output,
  2508.                                         [stem].vstring contains the table row
  2509.                                         number selected by the user.
  2510.  
  2511.                     FUNCTION RESULT     'OK', 'CANCEL', 'YES' or 'NO',
  2512.                                         depending on the value of [buttons]
  2513.  
  2514.                     Example:
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538. 34  VREXX:  Visual REXX for Presentation Manager
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545. (C) COPYRIGHT IBM CORP.  1992
  2546.  
  2547.  
  2548.                       /* display a table of data */
  2549.  
  2550.                       table.rows = 50
  2551.                       table.cols = 3
  2552.  
  2553.                       table.label.1 = 'Name'
  2554.                       table.label.2 = 'Division'
  2555.                       table.label.3 = 'Serial Number'
  2556.  
  2557.                       table.width.1 = 20
  2558.                       table.width.2 = 10
  2559.                       table.width.3 = 15
  2560.  
  2561.                       table.1.1 = 'John Doe'
  2562.                       table.1.2 = 10
  2563.                       table.1.3 = 'CR1034'
  2564.  
  2565.                       table.2.1 = 'Mary Jane'
  2566.                       table.2.2 = 44
  2567.                       table.2.3 = 'TX1143'
  2568.  
  2569.                       /* etc. */
  2570.  
  2571.                       table.50.1 = 'Joe Programmer'
  2572.                       table.50.2 = 11
  2573.                       table.50.3 = '001101'
  2574.  
  2575.                       call VTableBox 'Pick a row from the table', table, 1, 50, 15, 1
  2576.                       selection_number = table.vstring
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.                                                         COMMAND REFERENCE  35
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.                                                 (C) COPYRIGHT IBM CORP.  1992
  2612.  
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670. 36  VREXX:  Visual REXX for Presentation Manager
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677. (C) COPYRIGHT IBM CORP.  1992
  2678.  
  2679.  
  2680. EXAMPLE VREXX PROCEDURES
  2681. ________________________
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.                     This section provides several example REXX procedures
  2688.                     which give you some ideas about how to incorporate the
  2689.                     VREXX functions in your own REXX programs.  The following
  2690.                     examples are presented:
  2691.  
  2692.                     TESTWIN.CMD         Shows creation and manipulation of PM
  2693.                                         windows, text display, etc.
  2694.  
  2695.                     TESTDLGS.CMD        Demonstrates the use of the standard
  2696.                                         dialog functions, including filename
  2697.                                         and list item selections.
  2698.  
  2699.                     TESTDRAW.CMD        Draws some arbitrary graphics to PM
  2700.                                         windows.
  2701.  
  2702.  
  2703. TESTWIN.CMD
  2704. ___________
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738.                                                  EXAMPLE VREXX PROCEDURES  37
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.                                                 (C) COPYRIGHT IBM CORP.  1992
  2746.  
  2747.  
  2748.                       /* TESTWIN.CMD */
  2749.  
  2750.                       '@echo off'
  2751.                       call RxFuncAdd 'VInit', 'VREXX', 'VINIT'
  2752.                       initcode = VInit()
  2753.                       if initcode = 'ERROR' then signal CLEANUP
  2754.  
  2755.                       signal on failure name CLEANUP
  2756.                       signal on halt name CLEANUP
  2757.                       signal on syntax name CLEANUP
  2758.  
  2759.                       /* display the version number of VREXX */
  2760.  
  2761.                       ver = VGetVersion()
  2762.                       msg.0 = 1
  2763.                       msg.1 = 'VREXX version # ' ver
  2764.                       call VMsgBox 'TESTWIN.CMD', msg, 1
  2765.  
  2766.                       /* open a window and draw some text */
  2767.  
  2768.                       win.left   = 20
  2769.                       win.right  = 70
  2770.                       win.top    = 80
  2771.                       win.bottom = 40
  2772.                       id = VOpenWindow('My VREXX Window', 'RED', win)
  2773.  
  2774.                       text.1 = 'This is a VREXX window, created with a call to VOpenWindow.'
  2775.                       text.2 = 'The window currently has a title = My VREXX Window, and it'
  2776.                       text.3 = 'has a red background, which can be changed by a call to the'
  2777.                       text.4 = 'VBackColor function.  The font is 12 point Times Roman.'
  2778.  
  2779.                       call VForeColor id, 'WHITE'
  2780.                       call VSetFont id, 'TIME', 12
  2781.  
  2782.                       x = 10
  2783.                       y = 900
  2784.                       do i = 1 to 4
  2785.                          call VSay id, x, y, text.i
  2786.                          y = y - 50
  2787.                       end
  2788.  
  2789.                       /* now display a message box */
  2790.  
  2791.                       msg.0 = 2
  2792.                       msg.1 = 'Press OK to change the window title, the'
  2793.                       msg.2 = 'window background color, and the font...'
  2794.                       call VMsgBox 'TESTWIN.CMD', msg, 1
  2795.  
  2796.                       /* change the title and background color */
  2797.  
  2798.                       call VSetTitle id, 'A New Title!'
  2799.                       text.2 = 'The new window title = A New Title!, and it'
  2800.  
  2801.                       call VClearWindow id
  2802.  
  2803.  
  2804. 38  VREXX:  Visual REXX for Presentation Manager
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811. (C) COPYRIGHT IBM CORP.  1992
  2812.  
  2813.  
  2814.                       call VBackColor id, 'BLUE'
  2815.                       text.3 = 'has a blue background, which can be changed by a call to the'
  2816.                       call VForeColor id, 'WHITE'
  2817.  
  2818.                       /* change the font */
  2819.  
  2820.                       call VSetFont id, 'HELVB', 15
  2821.                       text.4 = 'VBackColor function.  The font is now 15 point Helvetica Bold.'
  2822.  
  2823.                       /* redraw the text in the window */
  2824.  
  2825.                       x = 10
  2826.                       y = 900
  2827.                       do i = 1 to 4
  2828.                          call VSay id, x, y, text.i
  2829.                          y = y - 60
  2830.                       end
  2831.  
  2832.                       /* now move and resize the window */
  2833.  
  2834.                       msg.0 = 3
  2835.                       msg.1 = 'Now the window will be cleared and moved around'
  2836.                       msg.2 = 'and resized using the VResize function.  Press'
  2837.                       msg.3 = 'OK to continue...'
  2838.                       call VMsgBox 'TESTWIN.CMD', msg, 1
  2839.  
  2840.                       call VClearWindow id
  2841.  
  2842.                       win.left   = 5
  2843.                       win.right  = 15
  2844.                       win.bottom = 80
  2845.                       win.top    = 95
  2846.                       call VResize id, win
  2847.  
  2848.                       do 8
  2849.                          win.left   = win.left   + 5
  2850.                          win.right  = win.right  + 10
  2851.                          win.top    = win.top    - 5
  2852.                          win.bottom = win.bottom - 10
  2853.                          call VResize id, win
  2854.                       end
  2855.  
  2856.                       /* put up a message box */
  2857.  
  2858.                       msg.0 = 1
  2859.                       msg.1 = 'Press Cancel to end...'
  2860.                       call VMsgBox 'TESTWIN.CMD', msg, 2
  2861.  
  2862.                       call VCloseWindow id
  2863.  
  2864.                       /* end of CMD file */
  2865.  
  2866.                       CLEANUP:
  2867.                          call VExit
  2868.  
  2869.  
  2870.                                                  EXAMPLE VREXX PROCEDURES  39
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.                                                 (C) COPYRIGHT IBM CORP.  1992
  2878.  
  2879.  
  2880.  
  2881.                       exit
  2882.  
  2883.  
  2884. TESTDLGS.CMD
  2885. ____________
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.  
  2914.  
  2915.  
  2916.  
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937. 40  VREXX:  Visual REXX for Presentation Manager
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944. (C) COPYRIGHT IBM CORP.  1992
  2945.  
  2946.  
  2947.                       /* TESTDLGS.CMD */
  2948.  
  2949.                       '@echo off'
  2950.                       call RxFuncAdd 'VInit', 'VREXX', 'VINIT'
  2951.                       initcode = VInit()
  2952.                       if initcode = 'ERROR' then signal CLEANUP
  2953.  
  2954.                       signal on failure name CLEANUP
  2955.                       signal on halt name CLEANUP
  2956.                       signal on syntax name CLEANUP
  2957.  
  2958.                       /* example VMsgBox call */
  2959.  
  2960.                       msg.0 = 4
  2961.                       msg.1 = 'This is a 4 line message box dialog.'
  2962.                       msg.2 = 'This is the line 2.  Line 3 is blank.'
  2963.                       msg.3 = ''
  2964.                       msg.4 = 'Press YES or NO to continue...'
  2965.  
  2966.                       call VDialogPos 50, 50
  2967.                       rb = VMsgBox('TESTDLGS.CMD', msg, 6)
  2968.                       if rb = 'YES' then do
  2969.                          msg.0 = 1
  2970.                          msg.1 = 'You pressed YES'
  2971.                       end
  2972.                       else do
  2973.                          msg.0 = 1
  2974.                          msg.1 = 'You pressed NO'
  2975.                       end
  2976.                       call VMsgBox 'VMsgBox Result', msg, 1
  2977.  
  2978.                       /* VInputBox example */
  2979.  
  2980.                       prompt.0 = 2
  2981.                       prompt.1 = 'Enter your name'
  2982.                       prompt.2 = '(Last name first, First name last)'
  2983.                       prompt.vstring = 'Doe John'
  2984.                       button = VInputBox('VInputBox example', prompt, 20, 3)
  2985.  
  2986.                       if button = 'OK' then do
  2987.                          msg.0 = 3
  2988.                          msg.1 = 'You entered the name'
  2989.                          msg.2 = prompt.vstring
  2990.                          msg.3 = 'and you pressed OK'
  2991.                       end
  2992.                       else do
  2993.                          msg.0 = 1
  2994.                          msg.1 = 'You pressed CANCEL'
  2995.                       end
  2996.                       call VMsgBox 'VInputBox Result', msg, 1
  2997.  
  2998.                       /* VMultBox example */
  2999.  
  3000.                       prompt.0 = 2   /* 2 prompt lines */
  3001.  
  3002.  
  3003.                                                  EXAMPLE VREXX PROCEDURES  41
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.                                                 (C) COPYRIGHT IBM CORP.  1992
  3011.  
  3012.  
  3013.                       prompt.1 = 'User ID'
  3014.                       prompt.2 = 'Password'
  3015.  
  3016.                       width.0 = 2
  3017.                       width.1 = 10   /* widths in character units */
  3018.                       width.2 = 8    /* for both entryfields */
  3019.  
  3020.                       hide.0 = 2
  3021.                       hide.1 = 0     /* echo the User ID input */
  3022.                       hide.2 = 1     /* don't echo the Password */
  3023.  
  3024.                       answer.0 = 2
  3025.                       answer.1 = ''  /* these are the default strings */
  3026.                       answer.2 = ''  /* which will contain the input */
  3027.  
  3028.                       button = VMultBox('VMultBox example', prompt, width, hide, answer, 3)
  3029.  
  3030.                       if button = 'OK' then do
  3031.                          call VMsgBox 'VMultBox Result', answer, 1
  3032.                       end
  3033.                       else do
  3034.                          msg.0 = 1
  3035.                          msg.1 = 'You pressed CANCEL'
  3036.                          call VMsgBox 'VMultBox Result', msg, 1
  3037.                       end
  3038.  
  3039.                       /* VListBox example */
  3040.  
  3041.                       list.0 = 17
  3042.                       list.1  = 'OS/2 2.0 Standard Edition'
  3043.                       list.2  = 'OS/2 2.0 Extended Edition'
  3044.                       list.3  = 'MMPM/2 Multimedia Extensions'
  3045.                       list.4  = 'Windows 3.0 Multimedia Extensions'
  3046.                       list.5  = 'Adobe Type Manager'
  3047.                       list.6  = 'C-Set/2 Compiler'
  3048.                       list.7  = 'OS/2 2.0 Programmer Toolkit'
  3049.                       list.8  = 'WorkFrame/2'
  3050.                       list.9  = 'Lan Server'
  3051.                       list.10 = 'Lan Requester'
  3052.                       list.11 = 'TCP/IP'
  3053.                       list.12 = 'PMGlobe Demo Program'
  3054.                       list.13 = 'ASYNC Terminal Emulator'
  3055.                       list.14 = 'IPFC Preprocessor'
  3056.                       list.15 = 'VREXX'
  3057.                       list.16 = 'OS/2 2.0 Corrective Service'
  3058.                       list.17 = 'IBM SAA CUA Controls Library'
  3059.                       list.vstring = list.15          /* default selection */
  3060.  
  3061.                       call VDialogPos 25, 25
  3062.                       call VListBox 'Select a Product and Press YES', list, 35, 8, 4
  3063.                       msg.0 = 1
  3064.                       msg.1 = list.vstring
  3065.                       call VMsgBox 'VListBox Selection', msg, 1
  3066.  
  3067.  
  3068.  
  3069. 42  VREXX:  Visual REXX for Presentation Manager
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076. (C) COPYRIGHT IBM CORP.  1992
  3077.  
  3078.  
  3079.                       /* test of VTableBox */
  3080.  
  3081.                       table.rows = 5
  3082.                       table.cols = 3
  3083.  
  3084.                       table.label.1 = 'Name'
  3085.                       table.label.2 = 'Division'
  3086.                       table.label.3 = 'Serial Number'
  3087.  
  3088.                       table.width.1 = 25
  3089.                       table.width.2 = 10
  3090.                       table.width.3 = 15
  3091.  
  3092.                       table.1.1 = 'Mary Jacobs'
  3093.                       table.1.2 = 20
  3094.                       table.1.3 = '243611'
  3095.  
  3096.                       table.2.1 = 'Joe Johnson'
  3097.                       table.2.2 = 19
  3098.                       table.2.3 = '837462'
  3099.  
  3100.                       table.3.1 = 'Henry Hill'
  3101.                       table.3.2 = 79
  3102.                       table.3.3 = '832628'
  3103.  
  3104.                       table.4.1 = 'Ruby Potts'
  3105.                       table.4.2 = 11
  3106.                       table.4.3 = '937567'
  3107.  
  3108.                       table.5.1 = 'Gary Williams'
  3109.                       table.5.2 = 22
  3110.                       table.5.3 = '086203'
  3111.  
  3112.                       button = VTableBox('Employee List', table, 1, 40, 10, 1)
  3113.  
  3114.                       msg.0 = 2
  3115.                       msg.1 = 'Button pressed was' button
  3116.                       msg.2 = 'Selection number =' table.vstring
  3117.                       call VMsgBox 'VTableBox Result', msg, 1
  3118.  
  3119.                       /* VRadioBox example */
  3120.  
  3121.                       list.0 = 10
  3122.                       call VRadioBox 'Select 1 item', list, 1
  3123.                       msg.0 = 1
  3124.                       msg.1 = list.vstring
  3125.                       call VMsgBox 'Selected item', msg, 1
  3126.  
  3127.                       /* test of VCheckBox */
  3128.  
  3129.                       list.0 = 10
  3130.                       sel.0 = 2
  3131.                       sel.1 = list.2
  3132.                       sel.2 = list.3
  3133.  
  3134.  
  3135.                                                  EXAMPLE VREXX PROCEDURES  43
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.                                                 (C) COPYRIGHT IBM CORP.  1992
  3143.  
  3144.  
  3145.                       call VCheckBox 'Select items', list, sel, 1
  3146.                       if sel.0 > 0 then do
  3147.                          call VMsgBox 'Selected items', sel, 1
  3148.                       end
  3149.  
  3150.                       /* VColorBox example */
  3151.  
  3152.                       call VDialogPos 75, 75
  3153.                       color.fore = 'YELLOW'
  3154.                       color.back = 'BLUE'
  3155.                       call VColorBox color
  3156.                       msg.0 = 2
  3157.                       msg.1 = 'Foreground color is' color.fore
  3158.                       msg.2 = 'Background color is' color.back
  3159.                       call VMsgBox 'Color selections', msg, 1
  3160.  
  3161.                       /* VFontBox example */
  3162.  
  3163.                       font.type = 'HELVB'
  3164.                       font.size = 25
  3165.                       call VFontBox font
  3166.                       msg.0 = 2
  3167.                       msg.1 = 'Font type is' font.type
  3168.                       msg.2 = 'Font size is' font.size
  3169.                       call VMsgBox 'Font selection', msg, 1
  3170.  
  3171.                       /* test of VFileBox */
  3172.  
  3173.                       call VDialogPos 10, 50
  3174.                       button = VFileBox('Pick a file...', 'c:\os2\*.exe', 'file')
  3175.                       msg.0 = 3
  3176.                       msg.1 = 'File name picked was'
  3177.                       msg.2 = file.vstring
  3178.                       msg.3 = 'Button pressed was' button
  3179.                       call VMsgBox 'VFileBox Result', msg, 1
  3180.  
  3181.                       /* end of CMD file */
  3182.  
  3183.                       CLEANUP:
  3184.                          call VExit
  3185.  
  3186.                       exit
  3187.  
  3188.  
  3189. TESTDRAW.CMD
  3190. ____________
  3191.  
  3192.  
  3193.  
  3194.  
  3195.  
  3196.  
  3197.  
  3198.  
  3199.  
  3200.  
  3201.  
  3202. 44  VREXX:  Visual REXX for Presentation Manager
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209. (C) COPYRIGHT IBM CORP.  1992
  3210.  
  3211.  
  3212.                       /* TESTDRAW.CMD */
  3213.  
  3214.                       '@echo off'
  3215.                       call RxFuncAdd 'VInit', 'VREXX', 'VINIT'
  3216.                       initcode = VInit()
  3217.                       if initcode = 'ERROR' then signal CLEANUP
  3218.  
  3219.                       signal on failure name CLEANUP
  3220.                       signal on halt name CLEANUP
  3221.                       signal on syntax name CLEANUP
  3222.  
  3223.                       /* set up marker types */
  3224.  
  3225.                       default      = 0
  3226.                       cross        = 1
  3227.                       plus         = 2
  3228.                       diamond      = 3
  3229.                       square       = 4
  3230.                       star6        = 5
  3231.                       star8        = 6
  3232.                       soliddiamond = 7
  3233.                       solidsquare  = 8
  3234.                       soliddot     = 9
  3235.                       circle       = 10
  3236.  
  3237.                       /* set up line types */
  3238.  
  3239.                       solid      = 0
  3240.                       dot        = 1
  3241.                       dash       = 2
  3242.                       dashdot    = 3
  3243.                       dotdot     = 4
  3244.                       longdash   = 5
  3245.                       dashdotdot = 6
  3246.  
  3247.                       /* set up fill types */
  3248.  
  3249.                       nofill    = 0
  3250.                       solidfill = 1
  3251.                       horz      = 2
  3252.                       vert      = 3
  3253.                       leftdiag  = 4
  3254.                       rightdiag = 5
  3255.  
  3256.                       /* create 2 windows for drawing some graphics */
  3257.  
  3258.                       win1.left   = 15
  3259.                       win1.bottom = 30
  3260.                       win1.right  = 55
  3261.                       win1.top    = 70
  3262.                       id1 = VOpenWindow('TESTDRAW.CMD Graphics Window 1', 'WHITE', win1)
  3263.  
  3264.                       win2.left   = 60
  3265.                       win2.bottom = 10
  3266.  
  3267.  
  3268.                                                  EXAMPLE VREXX PROCEDURES  45
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.                                                 (C) COPYRIGHT IBM CORP.  1992
  3276.  
  3277.  
  3278.                       win2.right  = 95
  3279.                       win2.top    = 40
  3280.                       id2 = VOpenWindow('TESTDRAW.CMD Graphics Window 2', 'BLACK', win2)
  3281.  
  3282.                       /* draw a line graph in window 1 */
  3283.  
  3284.                       call VForeColor id1, 'BLACK'
  3285.  
  3286.                       x.1 = 100
  3287.                       y.1 = 600
  3288.                       x.2 = 400
  3289.                       y.2 = 600
  3290.                       call VDraw id1, 'LINE', x, y, 2         /* x axis */
  3291.                       x.1 = 100
  3292.                       y.1 = 600
  3293.                       x.2 = 100
  3294.                       y.2 = 900
  3295.                       call VDraw id1, 'LINE', x, y, 2         /* y axis */
  3296.  
  3297.                       a = -0.000222   /* construct a quadratic polynomial */
  3298.                       b = 0.861       /* Y = a*X*X + b*X + c */
  3299.                       c = 566
  3300.  
  3301.                       x.1 = 100
  3302.                       y.1 = a*100*100 + b*100 + c
  3303.                       do i = 2 to 5
  3304.                          j = i - 1
  3305.                          x.i = x.j + 75
  3306.                          y.i = a * x.i * x.i + b * x.i + c
  3307.                       end
  3308.  
  3309.                       call VDrawParms id1, soliddiamond, dashdot, default
  3310.                       call VDraw id1, 'MARKER', x, y, 5
  3311.                       call VDraw id1, 'LINE', x, y, 5
  3312.  
  3313.                       /* draw a set of arcs in window 2 */
  3314.  
  3315.                       call VForeColor id2, 'YELLOW'
  3316.  
  3317.                       cx = 100
  3318.                       cy = 200
  3319.                       radius = 20
  3320.                       angle1 = 0
  3321.                       angle2 = 60
  3322.  
  3323.                       do i = 1 to 6
  3324.                          call VArc id2, cx, cy, radius, angle1, angle2
  3325.                          radius = radius + 20
  3326.                          cx = cx + 150
  3327.                          angle2 = angle2 + 60
  3328.                       end
  3329.  
  3330.                       /* draw a bar graph in window 1 */
  3331.  
  3332.  
  3333.  
  3334. 46  VREXX:  Visual REXX for Presentation Manager
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341. (C) COPYRIGHT IBM CORP.  1992
  3342.  
  3343.  
  3344.                       call VDrawParms id1, default, default, default
  3345.                       x.1 = 550
  3346.                       y.1 = 600
  3347.                       x.2 = 950
  3348.                       y.2 = 600
  3349.                       call VDraw id1, 'LINE', x, y, 2         /* x axis */
  3350.                       x.1 = 550
  3351.                       y.1 = 600
  3352.                       x.2 = 550
  3353.                       y.2 = 900
  3354.                       call VDraw id1, 'LINE', x, y, 2         /* y axis */
  3355.  
  3356.                       px.1 = 600
  3357.                       py.1 = 600
  3358.                       px.2 = 600
  3359.                       py.2 = 650
  3360.                       px.3 = 650
  3361.                       py.3 = 650
  3362.                       px.4 = 650
  3363.                       py.4 = 600
  3364.  
  3365.                       call VForeColor id1, 'RED'
  3366.                       do i = 1 to 6
  3367.                          /* draw bar with a new fill type */
  3368.  
  3369.                          call VDrawParms id1, default, solid, i-1
  3370.                          call VDraw id1, 'POLYGON', px, py, 4
  3371.                          call VDraw id1, 'LINE', px, py, 4
  3372.  
  3373.                          px.1 = px.1 + 50
  3374.                          px.2 = px.1
  3375.                          px.3 = px.3 + 50
  3376.                          px.4 = px.3
  3377.  
  3378.                          py.2 = py.2 + 45
  3379.                          py.3 = py.2
  3380.                       end
  3381.  
  3382.                       /* draw some lines of different types in window 2 */
  3383.  
  3384.                       color.1 = 'WHITE'               /* set up color array */
  3385.                       color.2 = 'RED'
  3386.                       color.3 = 'GREEN'
  3387.                       color.4 = 'BLUE'
  3388.                       color.5 = 'CYAN'
  3389.                       color.6 = 'YELLOW'
  3390.                       color.7 = 'PINK'
  3391.  
  3392.                       x.1 = 200
  3393.                       y.1 = 950
  3394.                       x.2 = 800
  3395.                       y.2 = 950
  3396.  
  3397.                       do i = 1 to 7
  3398.  
  3399.  
  3400.                                                  EXAMPLE VREXX PROCEDURES  47
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.                                                 (C) COPYRIGHT IBM CORP.  1992
  3408.  
  3409.  
  3410.                          call VForeColor id2, color.i
  3411.                          call VDrawParms id2, default, i-1, default
  3412.                          call VDraw id2, 'LINE', x, y, 2
  3413.  
  3414.                          y.1 = y.1 - 100
  3415.                          y.2 = y.1
  3416.                       end
  3417.  
  3418.                       /* set up a spline in window 1, drawing the control points */
  3419.                       /* of the spline as markers, and labelling them with text  */
  3420.  
  3421.                       sx.1 = 350
  3422.                       sy.1 = 450
  3423.                       sx.2 = 700
  3424.                       sy.2 = 200
  3425.                       sx.3 = 200
  3426.                       sy.3 = 125
  3427.                       sx.4 = 650
  3428.                       sy.4 = 425
  3429.  
  3430.                       call VForeColor id1, 'BLUE'
  3431.                       call VDrawParms id1, soliddot, default, default
  3432.                       call VDraw id1, 'MARKER', sx, sy, 4
  3433.                       call VDraw id1, 'SPLINE', sx, sy, 4
  3434.  
  3435.                       call VForeColor id1, 'GREEN'
  3436.                       call VSetFont id1, 'HELVB', 12
  3437.                       call VSay id1, 300, 75, 'Spline Control Points'
  3438.  
  3439.                       /* put up a message box */
  3440.  
  3441.                       msg.0 = 1
  3442.                       msg.1 = 'Press OK to close the windows'
  3443.                       call VMsgBox 'TESTDRAW.CMD', msg, 1
  3444.  
  3445.                       call VCloseWindow id1
  3446.                       call VCloseWindow id2
  3447.  
  3448.                       /* end of CMD file */
  3449.  
  3450.                       CLEANUP:
  3451.                          call VExit
  3452.  
  3453.                       exit
  3454.  
  3455.  
  3456.  
  3457.  
  3458.  
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466. 48  VREXX:  Visual REXX for Presentation Manager
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473. (C) COPYRIGHT IBM CORP.  1992
  3474.  
  3475.  
  3476. TECHNICAL DATA
  3477. ______________
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.                     VREXX packages its external functions in the dynamic link
  3484.                     library VREXX.DLL.  Thus, REXX procedures can load and
  3485.                     call the VInit function, which sets up system resources
  3486.                     and initializes the other VREXX external functions for
  3487.                     access by REXX.  The VExit function then frees up these
  3488.                     system resources before the REXX procedure exits.
  3489.  
  3490.                     When VInit is called, it starts a copy of the new
  3491.                     VREXX.EXE program and sets up a shared memory block to
  3492.                     pass variables between the DLL and the program.  The
  3493.                     program creates an invisible control window, and waits
  3494.                     for the VREXX external functions to post messages to the
  3495.                     window.  The control window then creates the windows,
  3496.                     draws graphics, processes dialogs, etc.
  3497.  
  3498.                     Variables are shared between the DLL and the REXX envi-
  3499.                     ronment through the shared variable pool.  Stem variables
  3500.                     are used to facilitate the use of REXX arrays by the
  3501.                     user.  Shared memory blocks and semaphores are used to
  3502.                     pass data and synchronize between the DLL and the control
  3503.                     window.
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.                                                            TECHNICAL DATA  49
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.                                                 (C) COPYRIGHT IBM CORP.  1992
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599. 50  VREXX:  Visual REXX for Presentation Manager
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606. (C) COPYRIGHT IBM CORP.  1992
  3607.  
  3608.  
  3609. RELEASE NOTES AND COMMENTS
  3610. __________________________
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.                     Version 1.0 (9/9/92) is the initial release.
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.  
  3641.  
  3642.  
  3643.  
  3644.  
  3645.  
  3646.  
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.  
  3658.  
  3659.  
  3660.  
  3661.  
  3662.  
  3663.  
  3664.  
  3665.  
  3666.                                                RELEASE NOTES AND COMMENTS  51
  3667.  
  3668.  
  3669.  
  3670.  
  3671.  
  3672.  
  3673.