new topic     » goto parent     » topic index » view thread      » older message » newer message

for <EUforum at topica.com>; Fri, 8 Aug 2003 12:05:24 -0400 (EDT)
	charset=3D"iso-8859-1"
From: George Walters <gwalters at sc.rr.com>
Subject: Re: Text lines into an array of unknown size
ZyYy3gEHAQAAAAAABwAAAAAAZVQTag at boing.topica.com>

i would try

tx =3D append(tx,line)

george
----- Original Message -----
From: <kjactive at adslhome.dk>
To: "EUforum" <EUforum at topica.com>
Subject: Text lines into an array of unknown size



as new commer from rexx to Euphoria I see many nice and semilare options an=
d
a richness of WinOS options but I have some
basic newcommer problems on 'sequence a array'

I want to open a file of text of unknown size and put all lines into an
array where every line can be manipulated but I cannot get it right...

integer file
object line
constant ERROR =3D 2
integer c
c =3D 0
sequence tx

file =3D open("c:/rexx/rxcalibur.txt", "r")
if file =3D -1 then
 puts(ERROR, "couldn't open text file\n")
else
 while 1 do
  line =3D gets(file)
  if atom(line) then
   exit
  end if
 c =3D c + 1
 tx[c] =3D line
 end while
end if
close(file)
printf(1,"available lines:%d\n", {c}) -- correct
printf(1,"%s\n",tx[2]) -- ERROR

Where do I get it wrong!!! Probably a newcommers init problem but I would
like some explane...

K=E5re Johansson



TOPICA - Start your own email discussion group. FREE!

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu