home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 19 Printer / 19-Printer.zip / LAPRINT.ZIP / ENINI.CMD < prev    next >
OS/2 REXX Batch file  |  1991-01-10  |  3KB  |  75 lines

  1. /************************************************************************
  2. *                                                                       *
  3. *  (c) Cray Research, Inc., 1991.  All rights reserved.                 *
  4. *                                                                       *
  5. *     This program and/or module and all modifications made by Cray     *
  6. *  Research, Inc., are the sole property of Cray Research, Inc., and    *
  7. *  shall not be made available to or used by any person or persons      *
  8. *  without the prior written permission of Cray Research, Inc.          *
  9. *                                                                       *
  10. *     Programs and/or modules which are deemed in the public domain or  *
  11. *  whose copyright is held by another legal entity other than Cray      *
  12. *  Research, Inc., shall be deemed excluded from the above named        *
  13. *  restrictions and protections.                                        *
  14. *                                                                       *
  15. *     All changes made by Cray Research Inc which represent original    *
  16. *  work, modifications, descriptions or ideas to the above excluded     *
  17. *  programs and/or modules shall not be made available to or used by    *
  18. *  any person or persons without the prior written permission of        *
  19. *  Cray Research, Inc.                                                  *
  20. *                                                                       *
  21. *                                                                       *
  22. *  Program name   :  enini                                              *
  23. *  Program purpose:  Convert an human readable file into a LaPrint      *
  24. *                    0.1 laprint.ini file.                              *
  25. *                                                                       *
  26. ************************************************************************/
  27. input_file = 'enini.ini'
  28. output_file = 'laprint.ini'
  29. number_printers = 0
  30. number_servers = 0
  31. number_output_lines = 1
  32.  
  33. if lines(input_file) = 0 then do
  34.   say input_file 'does not exist.'
  35.   exit 28
  36.   end
  37.  
  38. do i = 1 to 100000 while lines(input_file)
  39.   inline.i = linein(input_file)
  40.   end
  41. inline.0 = i - 1
  42.  
  43. do i = 1 to inline.0
  44.   parse var inline.i keyword '=' parameters
  45.  
  46.   select
  47.     when keyword = 'printer' then do
  48.       number_output_lines = number_output_lines + 1
  49.       output_lines.number_output_lines = number_printers   ||,
  50.                                          ' printer = '     ||,
  51.                                          parameters
  52.       number_printers = number_printers + 1
  53.      end
  54.  
  55.     when keyword = 'server' then do
  56.       number_output_lines = number_output_lines + 1
  57.       output_lines.number_output_lines = number_servers ||,
  58.                                          ' server = '   ||,
  59.                                          parameters
  60.       number_servers = number_servers + 1
  61.      end
  62.  
  63.     otherwise nop
  64.     end
  65.   end
  66.  
  67. output_lines.1 = 'LaPrint' number_printers number_servers
  68.  
  69. do i = 1 to number_output_lines
  70.   output_lines.i = bitxor(output_lines.i,,'80'x)
  71.   call lineout output_file, output_lines.i
  72.   end
  73.  
  74. exit
  75.