[futurebasic] Re: [FB] File Open & Save again

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

From: Brian Heibert <bheibert@...>
Date: Mon, 04 Oct 2004 22:29:39 -0500
In the .main file:
Dim gFileSpec as FSSpec

In the .incl file:
'~File Management

DIM gFileSpec
LOCAL FN loadSTR$(ID)
txt$ = ""
rHndl& = FN GETRESOURCE(_"STR ",ID)
LONG IF rHndl&
txt$ = PSTR$([rHndl&])
END IF
END FN=txt$

LOCAL FN SaveDoc
savprompt$ = FN loadSTR$(135)
filnm$ = FN loadSTR$(136)
// File Type: tbd~
fileName$ = FILES$(_fSave,savprompt$,filnm$,vRefNum%)
LONG IF LEN(filename$)
gFBUseNavServices = _zTrue
if filename$ = "" then filename$ = filnm$
DEF OPEN "tbd~"
//OPEN "O",1,filename$,,vRefNum%
GET FIELD efHandle&, efID%
WRITE FIELD #8001, efHandle&
CLOSE #1
KILL FIELD efHandle&
END IF
END FN

LOCAL FN OpenDoc
filename$=Files$(_fsspecOpen,"tbd~",,gFileSpec)
gFBUseNavServices = _zTrue
DEF OPEN "tbd~"
LONG IF LEN(filename$)
//OPEN "I",1, @gFileSpec
//Open "I",1,@gFileSpec

READ FIELD #8001, efHandle&
EDIT FIELD #8001, &efHandle&
CLOSE #1
KILL FIELD efHandle&

XELSE
BEEP
END IF
END FN






On 10/4/04 10:27 PM, "George Beckman" <gbeckman@...> wrote:

> Please send me the whole FN that is getting these errors, or if you
> have new errors (as I figure you are still working away) then tell me
> the new errors.
> ----
> Best Wishes,
> 
> George
> http://www.pggp.com
> On Oct 4, 2004, at 8:02 PM, Brian Heibert wrote:
> 
>> 
>> I am getting this:
>> Error:  End of Statement expected here...
>> After compiling this statement, I encountered extra (Unexpected)
>> information.
>> Example: Too many parameters or missing operation(s).
>> in file TBASIC.proj:TBASIC.MAIN at line 49 in FBStop
>> €Dim gFileSpec €as FSSpec
>> 
>> Error: Unknown Statement: 'as '
>> in file TBASIC.proj:TBASIC.MAIN at line 49 in FBStop
>> Dim gFileSpec €as €FSSpec
>> 
>> Brian
>> 
>> On 10/4/04 9:58 PM, "George Beckman" <gbeckman@...> wrote:
>> 
>>> Sorry,
>>> 
>>> I thought I remembered from the other day that you had gFileSpec
>>> declared.
>>> 
>>> Your current line...
>>> 
>>> DIM gFileSpec      the compiler assumes it an integer.
>>> 
>>> You need
>>> Dim gFileSpec as FSSpec    to tell the compiler that gFileSpec is not
>>> an integer but a record of several things:
>>> 
>>> vRefNum as a short integer
>>> parID as LONG
>>> name as STR63
>>> 
>>> This means that it contains all that stuff.   The Files$ is smart
>>> enough to get all of this from dialog and put in the right place.
>>> 
>>> 
>>> I also suggest you make your save match this as exactly as possible
>>> with the exceptions of the save stuff.   Use the fsSpec rather than
>>> the
>>> vRefNum%
>>> 
>>> ----
>>> Best Wishes,
>>> 
>>> George
>>> http://www.pggp.com
>>> On Oct 4, 2004, at 7:21 PM, Brian Heibert wrote:
>>> 
>>>> Error: OPEN ³xx²,n,@FSSpec requires the parameter after the @ to be
>>>> an
>>>> FSSpec variable.
>>>> in file TBASIC.proj:FILEMANAGEMENT.INCL at line 36 in OpenDoc
>>>> €Open "I",1,@gFileSpec€
>>>> 
>>>> Here's the code:
>>>> 
>>>> '~File Management
>>>> 
>>>> DIM gFileSpec
>>> --
>>> 
>> 
>> --
>> 
> 
> --
>