comp.lang.ada
 help / color / mirror / Atom feed
* File I/O Problem/Question
@ 1997-06-12  0:00 Jim Marley
  1997-06-12  0:00 ` Stephen Leake
  1997-06-12  0:00 ` Anonymous
  0 siblings, 2 replies; 3+ messages in thread
From: Jim Marley @ 1997-06-12  0:00 UTC (permalink / raw)



This is probably a simple problem, but I'm refreshing my knowledge of Ada
and it seems that I've forgotten more than I thought.

Problem:

I'm reading in a sequential text file, consisting of strings and integers. 
The file format is as follows:

string (variable length)
int int int int int (any number of integers)
string
int int int...
.. and so on.

I have it set up in two While loops (1. While not EOF, 2. While not EOL) -
here's the sudo code:

	while not eof
		get_line(file, string, last)
		
		while not eol
			get(file, int)
		end loop -- eol
	end loop -- eof
The program reads in the first string and first set of ints, it goes back
to the top (inside the "while not eof"), skips the get_line and tries to
"get" another int - causing a data exception because it's looking another
string.

Please let me know what I'm forgetting to do - and why it skips past the
get_line on the second pass.

Tks

Jim Marley 




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-06-12  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-06-12  0:00 File I/O Problem/Question Jim Marley
1997-06-12  0:00 ` Stephen Leake
1997-06-12  0:00 ` Anonymous

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox