home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / e / e032 / 3.ddi / FILES / PROGRAMM.PAK / MYREADLI.M < prev    next >
Encoding:
Text File  |  1992-07-29  |  578 b   |  23 lines

  1.  
  2. (*********************************************************************
  3.  
  4.         Adapted from
  5.         Roman E. Maeder: Programming in Mathematica,
  6.         Second Edition, Addison-Wesley, 1991.
  7.  
  8.  *********************************************************************)
  9.  
  10.  
  11. MyReadList[fileName_String, thing_:Expression] :=
  12.     Module[{file, expr, list = {}},
  13.         file = OpenRead[fileName];
  14.         If[ file === $Failed, Return[list] ];
  15.         While[ True,
  16.             expr = Read[file, thing];
  17.             If[ expr === EndOfFile, Break[] ];
  18.             AppendTo[list, expr]
  19.         ];
  20.         Close[file];
  21.         list
  22.     ]
  23.