home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / install / reqtools / rexxreqtools / examples / ttxarexx.lha / ExecMacro.ttx < prev    next >
Text File  |  1993-10-21  |  650b  |  27 lines

  1. /* $VER: ExecMacro.ttx 1.0 (19.02.93) */
  2.  
  3. OPTIONS RESULTS
  4.  
  5. LastMacro = GetClip( 'TTX_LastMacro' )
  6.  
  7. IF LastMacro = "" THEN LastMacro = "REXX:"
  8.  
  9. DirName = ""
  10. Index = LastPos( '/', LastMacro )
  11.  
  12. IF Index = 0 THEN Index = Index( LastMacro, ":" )
  13.  
  14. IF Index ~= 0 THEN DO
  15.   DirName = Left( LastMacro, Index )
  16.   FileName = SubStr( LastMacro, Index + 1 )
  17. END
  18.  
  19. FileName = rtFileRequest( DirName, FileName, "Select file to execute as ARexx macro", "_Exec", "RT_PubScrName=TURBOTEXT RTFI_Flags=FREQF_PATGAD RTFI_MatchPat=#?.ttx" )
  20.  
  21. IF rtResult ~= 0 THEN DO
  22.   SetClip( 'TTX_LastMacro', FileName )
  23.   INTERPRET 'CALL "' || FileName || '"'
  24. END
  25.  
  26. CALL rtFreeFileBuffer
  27.