Article View: comp.lang.modula2
Article #2053HELP!...how to read file of Integers into array without excess 0's
From: Shawn E Thompson
Date: Sat, 04 May 1991 15:45
Date: Sat, 04 May 1991 15:45
31 lines
1065 bytes
1065 bytes
Hi,
I have an array (say [0..50] ), and I want to read
a file of integers (the quantity of which is UNKOWN).
Right now it works ok, but the rest of the array fills with
zeroes, because I am using a test of DONE, which is always
true for INTEGERS.
REPEAT
ReadInt(array[i]);
INC(i);
UNTIL (NOT Done);
it reads all the numbers, then fills the rest of the array
because the rest of the file is blanks (it thinks are 0's)
any graceful way around this ???
TIA
ST
Technical Details
Message-ID:
<74846@eerie.acsu.Buffalo.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ub!ubvmsa.cc.buffalo.edu!v087mxgbShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ub!ubvmsa.cc.buffalo.edu!v087mxgb From: v087mxgb@ubvmsa.cc.buffalo.edu (Shawn E Thompson) Newsgroups: comp.lang.modula2 Subject: HELP!...how to read file of Integers into array without excess 0's Message-ID: <74846@eerie.acsu.Buffalo.EDU> Date: 4 May 91 15:45:01 GMT Sender: news@acsu.Buffalo.EDU Reply-To: v087mxgb@ubvmsa.cc.buffalo.edu Organization: University at Buffalo Lines: 31 Nntp-Posting-Host: ubvmsa.cc.buffalo.edu News-Software: VAX/VMS VNEWS 1.3-4.5