home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xwplascr.zip / XWPL0208.ZIP / tools / raisebld.cmd < prev    next >
OS/2 REXX Batch file  |  2000-01-04  |  2KB  |  52 lines

  1. /* */
  2. /*  RAISEBLD.CMD (new with V1.00):
  3.  *      this little script reads in the "build.h" file
  4.  *      and raises the XWorkplace build level by one.
  5.  *      This gets called by xfldr.mak after each successful
  6.  *      link of the whole XWorkplace thing.
  7.  *
  8.  *      Copyright (C) 1999 Ulrich Möller.
  9.  *      This file is part of the XFolder source package.
  10.  *      XFolder is free software; you can redistribute it and/or modify
  11.  *      it under the terms of the GNU General Public License as published
  12.  *      by the Free Software Foundation, in version 2 as it comes in the
  13.  *      "COPYING" file of the XFolder main distribution.
  14.  *      This program is distributed in the hope that it will be useful,
  15.  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  *      GNU General Public License for more details.
  18.  */
  19.  
  20. LineCount = 0;
  21. InputFile = "";
  22.  
  23. parse arg args
  24.  
  25. if args \= "" then
  26.     InputFileName = args
  27. else
  28.     InputFileName = "build.h";
  29.  
  30. InputFile = linein(InputFileName);
  31. parse var InputFile define ident level;
  32. call stream InputFileName, 'c', 'close';
  33.  
  34. if (substr(level, 1, 1) \= '"') then do
  35.     Say "raisebld: error parsing build.h";
  36.     exit;
  37. end
  38.  
  39. p = pos('"', substr(level, 2, 100));
  40. Level = substr(level, 2, length(level)-2);
  41. Newlevel = abs(Level)+1;
  42.  
  43. Output = define" "ident' "'Newlevel'"';
  44. Say Output
  45.  
  46. "del" InputFileName;
  47. call stream InputFileName, 'c', 'open write';
  48. rc = lineout(InputFileName, Output);
  49. call stream InputFileName, 'c', 'close';
  50.  
  51.  
  52.