home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / fm2utils.zip / cvtfbbs.cmd < prev    next >
OS/2 REXX Batch file  |  1998-05-25  |  2KB  |  52 lines

  1. /* Convert FILES.BBS files to WPS .SUBJECT EAs       */
  2. /* Modify to taste.                                  */
  3. /* As written, FILES.BBS file must be in the         */
  4. /* default directory.                                */
  5. /* Warning:  deletes FILES.BBS when done, change if  */
  6. /* desired.                                          */
  7.  
  8. '@echo off'
  9. describename = stream('FILES.BBS','C','query exists')
  10. if describename \= '' then
  11. do
  12.   destream = stream(describename,'C','open')
  13.   if destream = "READY:" then
  14.   do
  15.     say 'Working...'
  16.     call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  17.     call SysLoadFuncs
  18.     do while lines(describename)
  19.       text = linein(describename)
  20.       if text \= '' then
  21.       do
  22.         if left(text,1) \= ' ' then
  23.         do
  24.           if left(text,1) \= '-' then
  25.           do
  26.             parse var text filename text
  27.             text = left(text,40)
  28.             text = strip(text)
  29.             filename = strip(filename)
  30.             if filename \= '' then
  31.             do
  32.               if text \= '' then
  33.               do
  34.                 description = 'FDFF'x || d2c(length(text)) || '00'x || text
  35.                 call SysPutEA filename,'.SUBJECT',description
  36.               end
  37.             end
  38.           end
  39.         end
  40.       end
  41.     end
  42.     call stream describename,'C','close'
  43.  
  44.     /* done; delete file.  remove next line if that's not what you want. */
  45.     'del 'describename
  46.  
  47.   end
  48. end
  49. else
  50.   say 'File FILES.BBS not found in current directory.'
  51. exit
  52.