home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / afanv182.zip / F-Areas.Cmd < prev    next >
OS/2 REXX Batch file  |  1996-04-01  |  1KB  |  43 lines

  1. /***************************************************************************/
  2. /*   Areas.cmd for use with Afan The 'Advanced File Area Navigator'        */
  3. /*   Makes the fgroupA.asc file with file descriptions as comments,        */
  4. /*   fgroupA.asc is a listing of all available file areas.                 */
  5. /*   Just cut lines from this file to create the other fgroup?.asc files.  */
  6. /***************************************************************************/
  7.  
  8. /* ***************************** */
  9. /* Load Rexx Functions if needed */
  10. /* ***************************** */
  11.  
  12.  if RxFuncQuery("SysLoadFuncs") then do
  13.    rc = RxFuncAdd("SysLoadFuncs","RexxUtil","SysLoadFuncs")
  14.    rc = SysLoadFuncs()
  15.  end
  16.  
  17. areafile = "\adept\system\file_areas"
  18. outfile = "FgroupA.asc"
  19. call SysFileDelete(outfile)
  20.  
  21. rc = stream(areafile,'c','open read')
  22. rc = stream(outfile,'c','open write')
  23.  
  24.   DO WHILE Lines(areafile)
  25.       line = LineIn(areafile)
  26.       parse var line keyword value
  27.   SELECT
  28.       WHEN keyword = 'NAME' THEN
  29.        name = strip(value)
  30.       WHEN keyword = 'NUMBER' THEN
  31.        num = strip(value)
  32.       WHEN keyword = 'DESC' THEN
  33.        desc = strip(value)
  34.       WHEN keyword = 'AREAEND' THEN
  35.        Call LineOut outfile, Left(num,6)''Left(name,18)''desc
  36.       OTHERWISE
  37.        NOP
  38.     END
  39.   END
  40.  
  41. rc = stream(areafile,'c','close')
  42. rc = stream(outfile,'c','close')
  43.