home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / strprexx.cmd < prev    next >
OS/2 REXX Batch file  |  1997-12-24  |  907b  |  30 lines

  1. /* Strip a REXX script of tokenized REXX extended attributes.
  2.  * Only check if file exists if parameter was given. Run silent on success.
  3.  * Author: Kenneth Porter (72420.2436@compuserve.com)
  4.  */
  5.  
  6. /* make sure we got a real workfile */
  7. parse arg filename
  8.  
  9. fullfilename = ""
  10. if "" \= filename then fullfilename = stream(filename,'C','QUERY EXISTS')
  11. if "" == fullfilename then
  12. do
  13.     say '"' || filename || '" not found'
  14.     exit 1
  15. end
  16.  
  17. /* make the system call available */
  18. CALL RxFuncAdd 'SysPutEA', 'RexxUtil', 'SysPutEA'
  19.  
  20. /* say 'Stripping REXX binary' */
  21.  
  22. /* strip the four REXX-related extended attributes that contain
  23. the compiled version of the script */
  24. success = SysPutEA(filename,'REXX.METACONTROL','')
  25. success = SysPutEA(filename,'REXX.LITERALPOOL','')
  26. success = SysPutEA(filename,'REXX.VARIABLEBUF','')
  27. success = SysPutEA(filename,'REXX.TOKENSIMAGE','')
  28.  
  29. exit success
  30.