[futurebasic] Re: [FB] CFIndexRead using FSRef

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

From: Alain Pastor <apastor@...>
Date: Sat, 26 Jan 2008 01:28:41 +0100
Brian Stevens a crit :
> 
> On Jan 25, 2008, at 3:55 PM, Alain Pastor wrote:
>>
>> However, I don't know if FBtoC can handle all the possible variants of 
>> the syntax.
> .ref, ^ref @^ref are all handled in FBtoC
> 
>>
>> As to the @ symbol, many programmers (among the best I must add) use 
>> it as a reminder when calling Toolbox functions: it says that this 
>> parameter variable will have its value updated by the Toolbox function 
>> being called (besides that's why such a variable must have an address 
>> in memory and therefore cannot be located in a register). That symbol 
>> is optional in this case and I personally don't use that syntax by 
>> laziness.
> assume this refers to the the local fn (@x as ^something) syntax? versus 
> the using it to obtain the address of something.
> 
> AFAIK, the difference between  local fn a (@x as ^something)  versus  
> local fn b (x as ^something) is
>  the former case can be called via fn a(x) and it knows to send the 
> address of x without the programmer explicitly requesting it.
> 
> The latter syntax (except for structures) requires the fn b(@x) explicit 
> passing of the address
> 

Yes, you're right, but I was discussing here only about Toolbox calls 
for which it is not mandatory to explicitly pass the address of a 
variable whose value will be updated by the called function (FB does the 
work for us).

For instance, we could write equally this:

dim as rect r
window 1, "In Square Circle by Stevie"
SetRect( r, 10,10,100,100 )
FrameRect( r )
InsetRect( r, 20,20 )
FrameOval( r )

or that:

dim as rect r
window 1, "In Square Circle by Stevie"
SetRect( @r, 10,10,100,100 )
FrameRect( r )
InsetRect( @r, 20,20 )
FrameOval( r )

Alain