home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 17 / amigaformatcd17.iso / -in_the_mag- / emulation / flex / unpush.rexx < prev   
OS/2 REXX Batch file  |  1997-07-01  |  1KB  |  51 lines

  1. /* unpush.rexx */
  2.  
  3. arg fname drivename;
  4. if fname = "" then do
  5.   say "No filename! Command syntax is: unp filename drivename"
  6.   exit 0
  7.   end
  8. if drivename = "" then do
  9.   say "No drivename! Command syntax is: unp filename drivename"
  10.   exit 0
  11.   end
  12. /*
  13.  * open rexxsupport.library -- may be needed for some functions
  14.  */
  15. if ~show('L',"rexxsupport.library") then do
  16.   if addlib('rexxsupport.library',0,-30,0) then do
  17.       /* everything's ok */
  18.     end;
  19.   else do
  20.     say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
  21.     say 'Cannot operate RESOLVER.rexx without this library - sorry!';
  22.     exit 10;
  23.     end;
  24.   end;
  25.  
  26.   if ~open(whandle,"ram:ww",'write') then do
  27.     say cannot open write file!
  28.     exit 0
  29.     end
  30.  
  31.   if open(fhandle,fname,'read') then do /* open the file */
  32.     going = 1
  33.     do while going = 1
  34.       entry = readln(fhandle);
  35.       if entry ~= "" then do
  36.         bbyte = "xx";
  37.         do while bbyte ~= ""
  38.           parse var entry bbyte entry
  39.           if bbyte ~= "" then do
  40.             call writech(whandle,d2c(x2d(bbyte)));
  41.             end
  42.           end
  43.         end
  44.       else going = 0;
  45.       end
  46.   call close(fhandle);
  47.   end
  48. call close(whandle);
  49.  
  50. address command "inject ww" drivename fname;
  51.