Re: how get "number" in disk text file read into integer variable?

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

From: Dan B Moyer <DANMOYER at PRODIGY.NET>

Subject: Re: how get "number" in disk text file read into integer variable?


> Ok Irv,
>
> If you're suggesting that I may not have needed to do the integer-to-byte
&
> back again translation, I suspect you're probably right.

This stems from the fact that Euphoria has so many ways to input and output
data. It gets confusing as to which is the proper or best to use in a given
circumstance. Here's one way to do what you want:

include get.e
integer fn, y
object fontin
sequence fontout
 fontout = {1,2,3.1415,6,"Fillmore"}

-- write part of the data
fn = open("Font.dat","w")
print(fn,fontout) -- fontout[1..4] if you want to save only part
close(fn)

-- read the data
fn = open("Font.dat","r")
fontin = get(fn)
close(fn)
fontin = fontin[2] -- discard the disk read success flag

y = fontin[2]
print(1,y)

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

Search



Quick Links

User menu

Not signed in.

Misc Menu