[futurebasic] Re: [FB] 2 questions - one simple, one about FSSpec

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

From: Robert Covington <artlythere@...>
Date: Sun, 10 Mar 2002 18:50:56 -0500
>Folks----I'm probably overlooking something easy here since I've been
>busy Carbonizing for several hours now.
>
>First, the easy question:
>
>1. Why does the compiler tell me to use DIM @ for the "ignore"
>variable in FN lockfile? As you can see it is already defined to
>force non-register storage.

Your DIM location is suspect. I would leave it with each local FN.
However,as you are dimming them currently, if they are global, they are
rendered non-global by Local MODE.  Thus you have to DIM it again.


>2. The code below mostly works to create an FSSpec record (I proved
>that by OPENing the file and printing the contents using the FSSpec
>record). The problem is with FN lockfile and this is most likely
>where I'm going brain dead. If I just call the TB filelock directly
>with xx = FN FSpSetFLock(@PrefSpec), it locks the file and works
>fine.  If I try to call the FN lockFile I get a "volume not found"
>(-35) error.


Not sure of your problem...here is how I  pass an FSSpec as applied to your FN.

LOCAL FN lockFile(theFSSpecRec as ^FSSpec,bool%)
DIM @ ignore as INT
DIM mySpec as FSSpec // use @ if compiler complains.

mySpec = theFSSPecRec

LONG IF bool%
     ignore = FN FSpSetFLock(mySpec)
   XELSE
     ignore = FN FSpRstFLock(mySpec)
  END IF
END FN = ignore



Robert Covington