[futurebasic] Re: [FB] CGRect in Record

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2011 : Group Archive : Group : All Groups

From: Bernie <fblist.bw@...>
Date: Mon, 12 Dec 2011 14:46:34 +0000
Peter wrote:

> I have a laptop that runs under 10.6.8 using FB Version 5.7 and the following code works fine
> 
> Begin Record WebRects
> Dim Tension       as CGRect
> Dim Compression   as CgRect
> Dim TopChord      as CgRect
> Dim BtmChord      as CgRect
> 
> End Record
> '~'1
> 
> Local Fn DrawWebLayout(jj as CGRect,kk as CGRect,ll as CGRect,mm as CGRect)
> Fn DrawLineRect(jj)
> Fn DrawLineRect(kk)
> Fn DrawLineRect(ll)
> Fn DrawLineRect(mm)
> End Fn
> 
> However I need for it to run on our LAN at work which is 10.4.11 and FB Version 5.5.1
> When I try to compile @ work I get the following
> 
> Error: •• Parameter type mismatch in line 5 of Design2010_9.incl: parameter can't be record 
>   5:  Local Fn DrawWebLayout(jj as CGRect,kk as CGRect,ll as CGRect,mm as CGRect)
>                                          ^
> Obviously 5.7 is more modern and allows CGRect's within a Record but I need to run on the old system at work
> How would one code it to work on the old system? or is it just not possible.
> 

Change the params to ^CGRect (pointer to CGRect). You'll have to do same with DrawLineRect.

local fn DrawLineRect( r as ^CGRect )
// .....
end fn

local fn DrawWebLayout( jj as ^CGRect, kk as ^CGRect, ll as ^CGRect, mm as ^CGRect )
fn DrawLineRect( jj )
fn DrawLineRect( kk )
fn DrawLineRect( ll )
fn DrawLineRect( mm )
end fn

bw