home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vxcliser.zip / VXREXX.2 / MACROS / EPMPROTO / EPMPROTO.VRX < prev    next >
Text File  |  1994-12-23  |  1KB  |  44 lines

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