home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 531.lha / TurboText_Utils / LSETTX / lsettx.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1991-07-04  |  864 b   |  47 lines

  1. /* */
  2.  
  3. options results
  4. signal on halt
  5. signal on break_c
  6. signal on error
  7.  
  8. If ~Show("l","rexxsupport.library") then do
  9.    Call Addlib("rexxsupport.library",0,-30)
  10.    If Result=0 then Exit
  11.    end
  12.  
  13. port=openport("Lse")
  14.  
  15. if (port='0000 0000'X) then do
  16.     say "Couldn't open port."
  17.     exit
  18.     end
  19.  
  20. do forever
  21.     call waitpkt "Lse"
  22.     pkt=Getpkt("Lse")
  23.     if pkt="0000 0000"X then iterate
  24.  
  25.     arg=getarg(pkt)
  26.     parse var arg arg '00'x
  27.     Cmd=upper(Left(Arg,2))
  28.     select
  29.         when Cmd='OW' then Parse Var Arg 'OW UC' FileName .
  30.         when Cmd='LE' then Parse Var Arg 'LE ' ErrFile
  31.         when Cmd='NE' then do
  32.             FileName=Left(FileName, Length(FileName)-1);
  33.             call SetClip("ErrParse_ErrFile", ErrFile);
  34.             call SetClip("ErrParse_ErrLine", "1");
  35.             address command "TTX "filename" Macro ErrParse"
  36.             End
  37.         otherwise nop
  38.         end
  39.     call reply(pkt,0)
  40.     end
  41.  
  42. halt:
  43. error:
  44. break_c:
  45.     call closeport("Lse")
  46.     exit
  47.