Re: EndOfFile

*To*: mathgroup at yoda.physics.unc.edu*Subject*: Re: EndOfFile*From*: belopols at marie.mit.edu (Alexander Belopolsky)*Date*: Sun, 13 Mar 1994 13:24:02 -0500

Dear Mr. Love, The `EndOfFile' is a Mathematica symbol ``returned by Read when it reaches the end of a file'' and is NOT bound to any value. So far Mathematica can not evaluate "Any string"!=EndOfFile In[69]:= "Any string"!=EndOfFile Out[69]= Any string != EndOfFile The `While' loop stops either when test gives `False' or when it is undetermined and that's why when you are using `... != EndOfFile' Mathematica exits the `While' immediately. On the other hand `... != 10' works because In[71]:= "Any String"!=10 Out[71]= True and you can use anything but a string which may appear in your file instead of `10'. Yet I believe, that a more elegant way to do it is to use `=!=', which returns `False' whenever equality can not be established. Yours, Alexander Belopolsky. ========================================================== ------------------------ /| (--\\ | 6-409A, Center for Theoretical Physics //| || )) | Massachusetts Institute of Technology // | || // | 77 Massachusetts Ave. Cambrige MA 02139 ||==| ||^\\ /^^\ || /^^\ |^\ /^^\ || <__" ||/ \ || || | || )) |^^^ || || || |=/ || || || \ |< \// || | @ (|_// \==/ |__/ \==/ | \==/ |__/ \__/ ||\ _// ______________________________________________________________ ______________________________________________________________