[futurebasic] Re: [FB] More on saving Vrefs%

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

From: Rick Brown <rbrown@...>
Date: Thu, 22 Oct 1998 19:37:44 -0500
TJ wrote:
> Is there something that can be done to this function to return some type of
> "saveable" reference number?

It sounds like you want some number (or similar small amount of data)
which will still "stand for" the same object tomorrow that it does
today.

Really, the best thing to do is create an alias record and save that. 
That's the whole purpose of alias records--to allow you to track an
object over time.

If you don't like aliases (although they're not complicated), then there
are a couple of other "permanent" ID numbers associated with files and
folders that you might find useful.

Associated with each directory there's a "directory ID number" (DirID)
which is assigned when the directory is created, and it never changes,
and is different for every directory on the volume.  But to access a
directory by its DirID, you need to also specify what volume it's on,
and that's the catch, because volume ID numbers are _not_ permanent, but
are assigned at the time the volume gets mounted (your floppy or CD
might be volume #-3 when you mount it today, but volume #-7 when you
mount it tomorrow).  It's a pretty safe bet that your startup volume
will always get assigned a number of -1, but beyond that it's a
crapshoot.

Associated with each file, there's a "file ID number," which is also
permanent--it's analogous to the directory ID number.  But it's not very
useful, because you can't really access a file by its ID number.

- Rick