[futurebasic] Re: [FB] Unclear on the wdrefnum concept

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2002 : Group Archive : Group : All Groups

From: Alain Pastor <pixmix@...>
Date: Thu, 27 Jun 2002 15:27:29 +0200
"Steven J. Stratford" wrote:

> > If you want to call the Toolbox functions that deal with a parameter
> > block anyway, you need to convert that fake reference to something
> > useful. Whether before setting the fields of the parameter block (with
> > the runtime built-in function FBFixDirAndVol(vol,dir) I think) or
> > after setting the parameter block (with FBWDtoPBWD(parameterBlock)
> 
> So these two little conversion routines would only be used if one were to
> want to use FB FILES$ functions _along with_ toolbox functions, did I read
> that correctly?
> 
Actually almost all the FB functions related to the handling of files
have been enhanced in order to accept an FSSpec structure with no
hassle. In that case, the info returned by the FILES$ functions are
perfectly valid and you can use them in Toolbox functions of the FSpec
variant (of course, you can then forget the two conversion routines above).
For compatibility reasons FB still allows the use of the outdated (and
dead in Carbon) Working Directory Reference Number. The magic is quite
transparent for the programmers who can see 15 years old BASIC code
still working in Carbon with no change. While it is a really amazing
thing and certainly another great Andy's trick, I'm reluctant to
promote such a feature, I would rather promote to stick to Apple's
recommendations. Now the weird thing is that even the FSSpec structure
seems a bit outdated for OS X, but as I know nothing about FSRef which
is the yet again new Apple's entity, I won't comment any further. 
 -- 
Cheers,

Alain