comp.lang.ada
 help / color / mirror / Atom feed
From: "Jim Marley" <jcmarle@qis.net>
Subject: File I/O Problem/Question
Date: 1997/06/12
Date: 1997-06-12T00:00:00+00:00	[thread overview]
Message-ID: <01bc772c$238c60c0$LocalHost@jcmarle> (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 




             reply	other threads:[~1997-06-12  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-12  0:00 Jim Marley [this message]
1997-06-12  0:00 ` File I/O Problem/Question Anonymous
1997-06-12  0:00 ` Stephen Leake
replies disabled

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