[futurebasic] Re: VolRefNum Revisited- Homing in

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: David Blache <tech@...>
Date: Fri, 12 Dec 97 16:57:51 -0600
In a message dated 12/12/97 12:34 AM, you wrote:

>>be able to go to a Last File Saved
>>menu item and 1) mount the server,  2)  view the file and 3) have the next
>>standard open (getFile) dialog be set to the same folder as the file pointed
>>to by the alias.
>
>I can get to 1 & 2 no problem.  The line:
>
>>PARENTID = parID&
>
>Does fake the line
>
>>OPEN "R",1,filename$,,vRefNum%
>
>into thinking it has a vRefNum%
>
>Now, if I can accomplish # 3, I will be a hero and a happy man.

Well if I remember right (I haven't ever had the need to do it myself), 
when you want to set the location in subsequent standard file dialogs, 
you need to set two globals right before bringing the dialog up.  These 
constants are defined in FB:

_CurDirStore = 920      'the directory ID
_SFSaveDisk  = 532      'the "hard" volume reference number

It's probably a good idea to restore these to their original values once 
you are done.  So, this is how I think you would do it:

gMySaveDir& = [_CurDirStore]  'store them for later
gMySaveVol% = {_SFSaveDisk}

& _CurDirStore, myDir&        'set them up
% _SFSaveDisk,  -myVol%       'always negate the volrefnum

'do your standard file stuff here

& _CurDirStore, gMySaveDir&   'restore them now
% _SFSaveDisk,  gMySaveVol%


 (This message was constructed without the use of any Microsoft products)

|------------------------------------------------------------------------|
|    David Blache - STAZologist   /   STAZ Software Technical Support    |
|------------------------------------------------------------------------|
|    STAZ Software * 4387 Leisure Time Drive * Diamondhead, MS  39525    |
|------------------------------------------------------------------------|
|   Orders             800-348-2623   Email:    sales@...   |
|   Technical Support  601-255-7085   Technical: tech@...   |
|   FAX                601-255-7086   WWW: http://www.stazsoftware.com   |
|------------------------------------------------------------------------|
| Join the FutureBASIC programming community now! Send any email to:     |
| futurebasic-subscribe@....                                   |
|------------------------------------------------------------------------|