[futurebasic] Re: [FB] Carbon b11 variable warnings

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2004 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Sat, 19 Jun 2004 16:42:53 -0400
On Saturday, June 19, 2004, at 08:47  AM, Rich Love wrote:

> Why do I get warnings about variables being rounded up when I compile 
> my app.
> For instance I get a warning about the following dim
> dim 10 theType$
>
> The warning says, "Warning: Variable address rounded up to even 
> address"
>
>
> Rich Love - Carnation Software
> MacWise Terminal emulation for Macintosh
> richlove@...
> http://www.carnation-software.com
> 512 858-9234

The most common cause, though there can be others, are "dangling"  
'Boolean' or 'Char' or 'Byte' variable dims.

That is, you have


Dim this as Boolean
Dim thistoo as int

the compiler likes things more even and will give you that rounding 
message in this case, so you either need

dim this as boolean
dim matchthis as boolean // unused
dim  thistoo as int

or just

dim this as int
dim this as boolean // last var

...though you may as George said get them when doing certain length 
strings I reckon.


You can also add Dim & and Dim && at various places to aid alignment.

When in a local Function, I just make sure that any booleans or 
byte/char (any  1 byte anything) are the last dimmed, since they are 
usually just flag or settings variables and not used often.

r
c