[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 07:40:49 +0200
"Steven J. Stratford" wrote:
> 
> This function is off the release 6 CD, out of the file called Toolbox file
> handling:
> 
> DIM AS INT ioErr
> LOCAL FN NewFile (pb AS PTR, fNamePtr AS PTR TO STR31, Vol AS INT, Perm AS
> INT)
> 
> ioErr = FN OpenFile(pb, fNamePtr, Vol, Perm)
> 
> LONG IF ioErr = _FnfErr
> ioErr   = FN PBCreateSync(pb)
> LONG IF ioErr = _noErr
> ioErr = FN PBOpenSync(pb)
> END IF
> XELSE
> LONG IF ioErr = _noErr
> & pb +_ioMisc, 0
> ioErr = FN PBSetEOFSync(pb)'Clear Out File
> END IF
> END IF
> 
> END FN = ioErr
> 
> Has it been upgraded for OS X? The reason I'm asking is because I use
> earlier versions of those functions in that file in my CGIs, and I want to
> start making them OS X compliant.
> 
Steve,

In the function above, you probably will have to replace PBCreateSync
and PBOpenSync with PBHCreateSync and PBHOpenSync respectively. As a
side note, I would encourage you to start using the FSSpec structure
since the working directory reference number is dead in Macdom.
When you get such an entity from the FB FILES$ functions, it is a
reference internally maintained by the runtime that has no meaning for
the Toolbox. You can use this reference number as long as you use FB
statements only. While it is astonishing to see that living dead still
horny I would advocate for the riddance of that beast and particularly
with the Appearance runtime. I see no point in keeping that thing from
the past living artificially in that new runtime. 
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)

-- 
Cheers,

Alain