Forum Navigation
You need to log in to create posts and topics.

Re: VolRefNum Revisited- Homing in

Posted by: GBeckman <GBeckman@...>

First, I want to thank all of you for trying to help me with this one.

In a message dated 12/9/97 8:41:09 PM, Dave wrote:

>
>Thank goodness I keep scraps around... 😉
>
>'using FN MakeAlias & FN UseAlias with the OPEN command
>DIM spec;0,vRefNum%,parID&,filename$;64
>
>LONG IF FN useAlias(1000,spec)
>PARENTID = parID&
>OPEN "R",1,filename$,,vRefNum%
>END IF
>PARENTID = 0

This was in answer to:
(snip)
>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.

In the past I have used Andy's Routine:
CLEAR LOCAL MODE
DIM pBlock.128
DIM Noerr&
LOCAL FN SetFilesFolder(Vref%)
pBlock.ioVRefNum% = Vref%

LONG IF FN GETCATINFO(@pBlock) = _NoErr
& _CurDirStore , pBlock.ioDirID&
pBlock.ioWDProcID& = 0
pBlock.ioWDVRefNum% = 0
LONG IF FN GETWDINFO(@pBlock) = _NoErr
% _SFSaveDisk , -pBlock.ioWDVRefNum%
END IF
NoErr&=FN FLUSHVOL(@pBlock)
END IF
END FN

However, even after OPEN "R",1,filename$,,vRefNum% was successful, vRefNum% is
not valid, or at least will not make the FN SetFilesFolder(Vref%) routine
work.

Andy suggested I try something like this:

CLEAR LOCAL MODE
LOCAL FN ExtractVOL%(Vref%,ParID&)
DIM pBlock.128
DIM Noerr&, pBlk&
DIM paramBlk$

pBlk& = @paramBlk$
% pBlk& + _ioVRefNum ,VRef%
& pBlk& + _ioWDDirID ,ParID&
noErr& = FN OPENWD(pBlk&)
vRef% = {pBlk& + _ioVRefNum}

END FN=vRef%

Now that one I made up after talking to Andy on the phone. It may be
flawed. At any rate vRef% is not valid to operate FN SetFilesFolder(Vref%).

Rick suggested something like this:

CLEAR LOCAL
DIM osErr
DIM useAlias
DIM RECORD fsSpec
DIM fsVrefNum%
DIM fsParID&
DIM 63 fsName$
DIM END RECORD .fsSpec

DIM myFSSpec.fsSpec
LOCAL FN SeeAboutAQuickOpen

osErr=FN useAlias(1003,myFSSpec)

% _SFSaveDisk, -myFSSpec.fsVrefNum%
& _CurDirStore, myFSSpec.fsParID&

But alas, after trying these ideas in as many combinations I could think
of, the next GetFile is not pointing to the folder in which the original of
the alias resides.

Thanks in advance,

George