[futurebasic] Re: [FB] On aliases

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2006 : Group Archive : Group : All Groups

From: Jay Reeve <jayreeve@...>
Date: Mon, 23 Jan 2006 21:27:45 -0600
On Jan 23, 2006, at 8:17 PM, Russ Pagel wrote:

> Thanks Robert!  As you could see I was trying to graft FSNewAlias  
> into other
> toolbox examples and not doing it very well.  I'm curious what the  
> syntax
> means on a few things.
>
> For instance:
> local fn CreateAlias( f as ^FSSpec, @h as ^Handle )
>
> I assume the @ means "expect this to be a pointer to..."
More or less. It actually means "take the address of the variable  
passed, instead of its value."

> but what does the ^
> do?
One of the FB shorthands for PTR TO... These are all equivalent:
@h AS PTR TO HANDLE
@h AS ^HANDLE
@h AS .HANDLE
@h AS @HANDLE

>
>
>
> err = fn FSpMakeFSRef( #f, @ref )
> if ( _noErr == err ) then err = fn FSNewAlias( #0, @ref, #h )
>
> What does the # sign mean?
 From FB Help:
"If a function or pocedure expects to receive a variable (to which it  
may point for an address) as a parameter, you cannot substitute a  
specific address. The pound (#) symbol overrides that feature and  
tells FB not to convert the parameter to an address."

IOW, if you already have the needed address, you can pass it directly  
instead of passing a variable at that address.

e-e
=J= a  y
  "


>
> Thanks
>
> russp
>
>
>> From: Robert Purves <robert.purves@...>
>> Date: Mon, 23 Jan 2006 19:18:37 +1300
>> '--------
>> toolbox fn FSNewAlias( const FSRef * fromFile, const FSRef *target,
>> Handle *inAlias ) = OSErr
> <SNIP>
>
> --
>