[futurebasic] Re: VolRefNum Revisited- Homing in

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

From: GBeckman <GBeckman@...>
Date: Sat, 13 Dec 1997 19:13:16 EST
I have the feeling we are very close on this one.  Before we fight with PRam
too much, I am wondering why Andy's routine always works.  Been using it for
months and the directory is always set according to the routine rather than
the finder General Controls.  (I happen to keep my GC set to last folder used
by the app all the time.) For reference, the routine is below.  I am wondering
if  Flushing the Vol does the trick?

GB

  NoErr&=FN FLUSHVOL(@pBlock)

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