[futurebasic] Re: [FB] Controlling FILES$ for opening and saving

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2005 : Group Archive : Group : All Groups

From: George Beckman <gbeckman@...>
Date: Wed, 5 Jan 2005 23:06:51 -0800
John,

Here is my adjustment to subs files.incl   It is pretty simple, but I 
have to substitute my changes each time a new compiler comes out or it 
breaks.   I almost hate to have you start doing this too, but perhaps 
you can use this info to get the hack to work.


1) I declared two globals gFBNavStartsHere$ and gmyNavSpec
2) in my app startup I delcare gFBNavStartsHere$=""
3) if I want to have my Open dialog start somewhere I just do this:

      gFBNavStartsHere="Anything here"
     gmyNavSpec= and valid spec (with a blockmove)


Do a Files$ and all will be well.

Here is a routine where I do just that:

gFBNavStartsHere$="PGGP"
blockmove @gFileSpec,@gMyNavSpec,sizeOf(fsspec)  'need mynavspec to 
carry the news to navGetfile
gSaveName$=Files$(_fsspecOpen,"PGGP",,gFileSpec)
gFBNavStartsHere$=""

If you are interested I can send you the entire subs files.incl   It 
also has the change for the save file.   Here is the snippet of code I 
insert into the existing subs file.incl

'~Optional Files$ begin at folder...
'~':
'Start Here....George's
'osErr = fn NavGetFile( #0, fileReply, myNavDlogOptions, eventProc, 0, 
callback, typeListH, typeListH)
BEGIN GLOBALS
DIM gFBNavStartsHere$           ' So shoot me
dim gmyNavSpec as fsSpec         'I may have added this:   GB
END GLOBALS

DIM jDesc as aedesc
DIM UseFallBack

UseFallBack = _True
LONG IF LEN(gFBNavStartsHere$) > 0
  ' osErr = FN FSMAKEFSSPEC(0,0,gFBNavStartsHere$,jSpec)
   gFBNavStartsHere$ = ""
   LONG IF osErr = _noErr
     osErr = FN AECreateDesc( _"fss ", gMyNavSpec, sizeof( FSSpec ), 
jDesc )
     LONG IF osErr = _noErr
       osErr = FN NAVGETFILE( jDesc, fileReply, myNavDlogOptions, 
eventProc, 0, callback, typeListH, typeListH)
       osErr = FN AEDISPOSEDESC( jDesc )
       UseFallBack = _False
     END IF
   END IF
END IF

LONG IF UseFallBack = _True
osErr = FN NavGetFile( #0, fileReply, myNavDlogOptions, eventProc, 0, 
callback, typeListH, typeListH)
END IF

'~':

On Jan 5, 2005, at 7:00 PM, John McKernon wrote:

>> But I am controlling the
>> get file and save file's starting point.   I am saving a filespec as 
>> an
>> alias and controlling access to not only the local drive but to
>> servers...even across a WAN.   Be glad to look at what you have and 
>> see
>> if we can't get this going.
>>
----
Best Wishes,

George
http://www.pggp.com