home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vxdemo.zip / EPMPROTO.$$$ / EPMPROTO.VRX < prev    next >
Text File  |  1993-09-13  |  1KB  |  48 lines

  1. /*:VRX         Main
  2. */
  3. Main:
  4. /*  EPMProto.ERX
  5.  
  6.     Invoke the VX-REXX code generation dialogs from within the
  7.     Enhanced Editor (EPM).
  8.  
  9.     To use this macro you must set the VXREXX environment variable
  10.     to the VX-REXX root directory (e.g. C:\VXREXX).
  11. */
  12. /*  Uncomment to debug
  13.     call VRRedirectStdio
  14.     trace r
  15. */
  16.     VRXPath = value( "VXREXX",,"OS2ENVIRONMENT" )
  17.     if VRXPath \= "" then do        
  18.         file = VRXPath || "\VRXEDIT.EXE" 
  19.         file = stream( file, 'c', 'query exists' )
  20.         if file = "" then do
  21.             VRXPath = ""
  22.         end
  23.     end
  24.     if VRXPath = "" then do
  25.         text.1 = "The VXREXX environment variable is not set."
  26.         text.2 = ""
  27.         text.3 = "The VXREXX environment variable must be set"
  28.         text.4 = "to the VX-REXX directory (e.g. C:\VXREXX)."
  29.         text.0 = 4
  30.         call VRMessageStem "", "text.", "Error"
  31.         return
  32.     end
  33.  
  34.     call VRMethod "Application", "PutClipboard", ""
  35.     dispatch = '"' || VRXPath || '\VREDisp.VRM"( "", "", "CLIPBOARD")'
  36.     interpret 'codeString =' dispatch
  37.     if codeString = "" then return
  38.  
  39.     parse VAR codeString . "0d0a"x rest
  40.     if rest = "" then do
  41.         "PASTE C"
  42.     end
  43.     else do
  44.         "PASTE B"
  45.     end
  46.     return
  47.  
  48.