home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / pibterm / pibt41e3.arc / READCONF.SCR < prev    next >
Text File  |  1988-02-26  |  3KB  |  54 lines

  1. ***************************************************************************
  2. *       R E A D C O N F . S C R --- Read configuration file               *
  3. ***************************************************************************
  4. *
  5. *                                  Name of configuration file to be read
  6.  Import ConfName String
  7. *
  8. ***************************************************************************
  9. *                                                                         *
  10. *    Script:  ReadConf.Scr                                                *
  11. *                                                                         *
  12. *    Purpose: Reads a configuration file and resets PibTerm parameters.   *
  13. *                                                                         *
  14. *    Invocation:                                                          *
  15. *                                                                         *
  16. *       Execute "ReadConf" ConfName                                       *
  17. *                                                                         *
  18. *          ConfName --- Configuration file to read                        *
  19. *                                                                         *
  20. *          Example:    Execute "ReadConf" "Bogusco.Cnf"                   *
  21. *                                                                         *
  22. ***************************************************************************
  23. *
  24. *                                  Configuration line
  25.  Declare ConfLine String
  26. *                                  Configuration parameter name
  27.  Declare ConfName String
  28. *                                  Configuration parameter value
  29.  Declare ConfValue String
  30. *                                  Open configuration file.
  31. *
  32.  Open 1 ConfName "Input"
  33. *
  34. *                                  Check that open went OK -- if not,
  35. *                                  return to caller.
  36.  IF ( IOResult <> 0 ) THEN
  37.     EXIT
  38.  ENDIF
  39. *                                  Begin loop over configuration file.
  40.  REPEAT
  41. *                                  Read line from configuration file.
  42.     Readln 1 ConfLine
  43. *                                  Parse into parameter name and value.
  44. *
  45.     ConfName  = Substr( ConfLine, 1, 2 )
  46.     ConfValue = Substr( ConfLine, 4, 255 )
  47. *
  48. *                                  Set parameter value.
  49.     SetParam ConfName ConfValue
  50. *
  51.  UNTIL ( EOF( 1 ) )
  52. *                                  Close configuration file
  53.  Close 1
  54.