(* $Id: MyReadList.m,v 1.2 1991/08/14 23:48:09 rory Exp $ *) (********************************************************************* Adapted from Roman E. Maeder: Programming in Mathematica, Second Edition, Addison-Wesley, 1991. *********************************************************************) MyReadList[fileName_String, thing_:Expression] := Module[{file, expr, list = {}}, file = OpenRead[fileName]; If[ file === $Failed, Return[list] ]; While[ True, expr = Read[file, thing]; If[ expr === EndOfFile, Break[] ]; AppendTo[list, expr] ]; Close[file]; list ]