[futurebasic] Re: [FB] Open & Save

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 2004 : Group Archive : Group : All Groups

From: Brian Heibert <bheibert@...>
Date: Thu, 26 Aug 2004 18:37:08 -0500
On 8/26/04 6:26 PM, "Robert Covington" <artlythere@...> wrote:

> 
> On Thursday, August 26, 2004, at 06:48  PM, Brian Heibert wrote:
> 
>> Ok I got the OpenDialog appearing I can't test it to see if it will
>> open my
>> files until my savedialog works
>> 
>> 
>> OPEN:
>> OPEN "ID",#1,vRefNum%
>> READ FILE #1,container$
>> CLOSE #1
>> 
>> What do I put for SAVE:
>> 
>> Brian
> 
> Do you mean Container$, or Container$$?
> 
> if you meant Save as the reverse your above, then you'll need to
> specify things a bit differently for  a true container$$ when using
> Write statements.
> 
> rc
> 
>> 
>> 
>> On 8/24/04 11:23 PM, "George Beckman" <gbeckman@...> wrote:
>> 
>>> Brian,
>>> 
>>> The FN you are looking for is in Files in the help.  Then check out
>>> Open.   You open and close files by number.
>>> 
>>>  However, what you do next depends on what kind of information you
>>> want to save.  FB has ways to save edit fields, numbers, strings,
>>> records, etc.   (I am not trying to confuse you.)  But if we knew what
>>> kind of information you need to save and retrieve, we can direct you
>>> to
>>> a closer model of what you have in mind.
>>> 
>>> Much of my work saves arrarys of strings and arrays of numbers.   I
>>> tend to save the whole block of memory and then work on the
>>> information
>>> when I have it loaded in a memory block.   I am using Write File #1
>>> and
>>> Read File #1 to do this.
>>> 
>>> You can also use Read and Write for single pieces of information.
>>> These can be found in the help also.
>>> 
>>> At first all this can be very daunting, but once you get one little
>>> piece of a file working, you can expand quite easily.
>>> 
>>> I am cobbling together a simple (untested) model to save two integers,
>>> gMyFont% and gMySize%.
>>> 
>>> dim gMyFileSpec as fsSpec
>>> 
>>> gSaveName$=Files$(_fsspecOpen,"YRFL",,gMyFileSpec)   (YRFL would =
>>> file
>>> creator...)
>>> 
>>> 'produces a get file dialog
>>> 
>>> OPEN "O",#1,@gMyFileSpec             'opens the file
>>> WRITE#1, gMyFont%                          'saves
>>> WRITE#1, gMySize%
>>> CLOSE #1                                              'closes the file
>>> 
>>> to read it back in Open "I" and use Read#1
>>> ----
>>> Best Wishes,
>>> 
>>> George
>>> http://www.pggp.com
>>> On Aug 24, 2004, at 8:30 PM, Brian Heibert wrote:
>>> 
>>>> Where can I find a example on how to open & save files?
>>>> 
>>>> I am using FB 4
>>> 
>>> --
>>> 
>> 
>> --
>> 
> 
> --
> 
Actually I meant container$ I didn't realize it had another meaning as
container$$ until now

I am using container$ as a string
Container$ = EDIT$(1)