home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vxcliser.zip / VXREXX.2 / MACROS / EPMPROTO.VRM next >
Text File  |  1994-12-23  |  2KB  |  64 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 < 2.00 )then do
  8.         call VRMessage "", "This program requires VX-REXX version 2.00 to run", "Error!"
  9.         return 32000
  10.     end
  11.  
  12.     signal on SYNTAX name _VRESyntax
  13.     signal _VREMain
  14.  
  15. _VRESyntax:
  16.     parse source . . _VRESourceSpec
  17.     call VRMessage "", "Syntax error in" _VRESourceSpec "line" SIGL, "Error!"
  18.     exit 32000
  19.  
  20. _VREMain:
  21. /*:VRX         Main
  22. */
  23. /*  EPMProto.ERX
  24.  
  25.     Invoke the VX-REXX code generation dialogs from within the
  26.     Enhanced Editor (EPM).
  27.  
  28.     To use this macro you must set the VXREXX environment variable
  29.     to the VX-REXX root directory (e.g. C:\VXREXX).
  30. */
  31. Main:
  32.     epmWindow = VRMethod( "Screen", "GetActiveWindow" )
  33.     call VRMethod "Application", "PutVar", "epmWindow"
  34.     vrxpath = value( "VXREXX",,"OS2ENVIRONMENT" )
  35.     if( vrxpath = "" ) then do        
  36.         call VRMessage , "The VXREXX environment variable is not set.", , "E"
  37.         signal Done
  38.     end
  39.     if( Stream( vrxpath || "\VRXEDIT.EXE", 'c', 'query exists' ) = "" ) then do
  40.         vredisp = '"\VREDisp.VRM"'
  41.     end
  42.     else do
  43.         vredisp = '"' || VRXPath || '\VREDisp.VRM"'
  44.     end
  45.  
  46.     call VRMethod "Application", "PutClipboard", ""
  47.     interpret 'codeString =' vredisp || '( "", "", "CLIPBOARD" )'
  48.     if( codeString = "" ) then do
  49.         signal Done
  50.     end
  51.  
  52.     parse VAR codeString "0d0a"x codeString
  53.     if( codeString = "" ) then do
  54.         "PASTE C"
  55.     end
  56.     else do
  57.         "PASTE B"
  58.     end
  59.  
  60. Done:
  61.     drop vrxpath vredisp codeString
  62. return
  63.  
  64.