On Mar 26, 2007, at 11:07 AM, Orin Eman wrote: >> while (!fileerror(myfile)) { >> c = getchar(myfile); >> : >> } > > Does the above work for a zero length file? At EOF? > Your guess is as good as mine, since the example uses functions that (AFAIK) have not actually been implemented. This sort of construct was standard for Pascal programs, though, so it should be possible. An error status doesn't get set for the file till you actually try to read beyond the end of file. > while not eof(File1) do > begin > readln(File1,Score); > end; (had to look that up. Didn't remember what Pascal looked like.) BillW -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist