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

  1. /* Custom mainline for macro */
  2.  
  3.     call RXFuncAdd "VRLoadFuncs", "VROBJ", "VRLoadFuncs"
  4.     call VRLoadFuncs
  5.  
  6.     _VREVersion = SubWord( VRVersion( "VRObj" ), 1, 1 )
  7.     if( _VREVersion < 1.01 )then do
  8.         call VRMessage "", "This program requires VX-REXX version 1.01 to run", "Error!"
  9.         _VREReturnValue = 32000
  10.         signal _VRELeaveMain
  11.     end
  12.  
  13.     signal on SYNTAX name _VRESyntax
  14.     signal _VREMain
  15.  
  16. _VRESyntax:
  17.     parse source . . _VRESourceSpec
  18.     call VRMessage "", "Syntax error in" _VRESourceSpec "line" SIGL, "Error!"
  19.     exit 32000
  20.  
  21. _VREMain:
  22. /*:VRX         Main
  23. */
  24. Main:
  25. /*  EPMProto.ERX
  26.  
  27.     Invoke the VX-REXX code generation dialogs from within the
  28.     Enhanced Editor (EPM).
  29.  
  30.     To use this macro you must set the VXREXX environment variable
  31.     to the VX-REXX root directory (e.g. C:\VXREXX).
  32. */
  33. /*  Uncomment to debug
  34.     call VRRedirectStdio
  35.     trace r
  36. */
  37.     VRXPath = value( "VXREXX",,"OS2ENVIRONMENT" )
  38.     if VRXPath \= "" then do        
  39.         file = VRXPath || "\VRXEDIT.EXE" 
  40.         file = stream( file, 'c', 'query exists' )
  41.         if file = "" then do
  42.             VRXPath = ""
  43.         end
  44.     end
  45.     if VRXPath = "" then do
  46.         text.1 = "The VXREXX environment variable is not set."
  47.         text.2 = ""
  48.         text.3 = "The VXREXX environment variable must be set"
  49.         text.4 = "to the VX-REXX directory (e.g. C:\VXREXX)."
  50.         text.0 = 4
  51.         call VRMessageStem "", "text.", "Error"
  52.         return
  53.     end
  54.  
  55.     call VRMethod "Application", "PutClipboard", ""
  56.     dispatch = '"' || VRXPath || '\VREDisp.VRM"( "", "", "CLIPBOARD")'
  57.     interpret 'codeString =' dispatch
  58.     if codeString = "" then return
  59.  
  60.     parse VAR codeString . "0d0a"x rest
  61.     if rest = "" then do
  62.         "PASTE C"
  63.     end
  64.     else do
  65.         "PASTE B"
  66.     end
  67.     return
  68.  
  69.