home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / filerx11.zip / READ.CMD < prev    next >
OS/2 REXX Batch file  |  1994-03-30  |  1KB  |  32 lines

  1. /* */
  2.  
  3. /* The FileLoadFuncs loads all the rest of the REXX functions in the FILEREXX DLL. */
  4. /* So, we don't have to make calls to RxFuncAdd to add each one of those functions. Of */
  5. /* course, in order to call FileLoadFuncs, we have to add that one. */
  6. CALL RxFuncAdd 'FileLoadFuncs', 'FILEREXX', 'FileLoadFuncs'
  7. CALL FileLoadFuncs
  8.  
  9. /* =============================================================================== */
  10. /** Read in and display all lines of text from config.sys. **/
  11.  
  12. handle = FileOpen('c:\config.sys', 'r', "e")
  13. IF handle = 0 THEN DO
  14.    SAY "Error opening file 'c:\config.sys'"
  15.    EXIT
  16. END
  17.  
  18. DO FOREVER
  19.     contents = FileGets(handle)
  20.     IF FILEERR = 0 THEN LEAVE
  21.     SAY contents
  22. END
  23.  
  24. err = FileClose(handle)
  25. IF err <> 0 THEN SAY "Error closing file"
  26.  
  27.  
  28. /* =============================================================================== */
  29. /* FileDropFuncs: This unloads all of the functions in the FILEREXX DLL. That lets REXX */
  30. /* close the DLL. We could otherwise live it open for some other REXX script */
  31. CALL FileDropFuncs
  32.