1. Any Euphoria version of BSAVE (basic)
Is there a Euphoria command that makes a file so you can write information to
it? In BASIC all I need to use is BSAVE"file.txt",1,1:CLOSE, but I'm not sure
how to do it in EUphORia.
HELP ME & thanks,
STQUMAN
2. Re: Any Euphoria version of BSAVE (basic)
At 12:42 PM 4/18/98 EDT, ST Qu Man wrote:
>Is there a Euphoria command that makes a file so you can write information to
>it? In BASIC all I need to use is BSAVE"file.txt",1,1:CLOSE
How about fn = open("file.txt","wb") -- wb stands for write binary
The real question is, why are you wanting to use a binary
save to write a text file? BSAVE copies a block of memory
to a file, which would not usually be readable as text.
Irv
----------------------------------------------------------
--Visit my Euphoria programming web site:--
--http://www.mindspring.com/~mountains --
----------------------------------------------------------
3. Re: Any Euphoria version of BSAVE (basic)
>The real question is, why are you wanting to use a binary
>save to write a text file? BSAVE copies a block of memory
>to a file, which would not usually be readable as text.
>
I don't know about him, but BSAVE is a greate way to save a screen/with
attributes to a file for later use. I used to utlize that technique to
allow users to build screen layouts for databases that I had designed. (In
addition to the image, I saved field attributes as well.) (I also used it
when memory was a premium.)
Any way, it WAS also good for saving and restoring arrays, etc. But, that
was back before memory was so free.
By the way, it would be nice to do block i/o. ( Don't bother, I've already
written a function for that...)
--[ Joe Phillips, Assistant Director
--[ Texas Wesleyan University 817-531-4284
4. Re: Any Euphoria version of BSAVE (basic)
At 09:15 AM 4/20/98 -0700, you wrote:
>>The real question is, why are you wanting to use a binary
>>save to write a text file? BSAVE copies a block of memory
>>to a file, which would not usually be readable as text.
>>
>I don't know about him, but BSAVE is a greate way to save a screen/with
>attributes to a file for later use. I used to utlize that technique to
>allow users to build screen layouts for databases that I had designed. (In
>addition to the image, I saved field attributes as well.) (I also used it
>when memory was a premium.)
>
Good point. Our new Euphoria user may not realize there is a much=20
easier way to do that as well: save_text_image()
>Any way, it WAS also good for saving and restoring arrays, etc. But, that
>was back before memory was so free.
And before you could save an array (AKA sequence) with puts(fn,MyArray)
One line array reads/writes were one of the more useful features of Pascal,
as well.
Note to anybody: including a little more info with a question (like=
explaining
what you are trying to accomplish) will make it easier for people to answer
appropriately. For example: running the BASIC code given in the question:
BSAVE "TEST.TXT",1,1:CLOSE results in an 8-byte file containing
=FD=FAS=01 (in hex: FD FA 53 01 00 01 00 74). What we don't know is: was
the question how to create an EMPTY file, a general question about
how to create ANY file, how to create a BINARY file, or specifically=20
how to write 1 byte from offset 1 in the current SEG in BLOADable
format?
Irv