#30330 - 09/08/09 05:06 PM
Variable Rectangle
|
Junior Member
Registered: 06/19/09
Posts: 14
Loc: Indiana
|
I believe that I ran across on the forums a way to make a box that can grow, but I can not find it again. So, is it possible to replace the conditional information in the rectangle procedure? ie. instead of: rectangle(0,0,2.125,0.24,false,true) rectangle(0,0.24,1.75,0.48,false,true)
define(&i, float, 0.24) if(condition) rectangle(0,0,2.125,&i,false,true) else set(&i,&i + &i) rectangle(0,0,4,&i,false,true)
|
Top
|
|
|
|
#30331 - 09/09/09 10:16 AM
Re: Variable Rectangle
|
OL Expert
Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
|
brianp, Yes, it's possible. In fact, the logic you give as example should work fine. Don't forget to add the endif() at the end of the block. Also, in PlanetPress, "float" is called "measure" in variables definition(but it uses float for conversion functions such as floattostr...). So syntax would be something like: define(&i, measure, 0.24)
if(condition)
rectangle(0,0,2.125,&i,false,true)
else
rectangle(0,0,4,&i * 2,false,true)
endif() Instead of "set(&i,&i + &i)", you can just use "&i * 2" in the rectangle function, it will do the same thing. Hope that helps. Regards, Rapha
|
Top
|
|
|
|
#30332 - 09/09/09 10:45 AM
Re: Variable Rectangle
|
Junior Member
Registered: 06/19/09
Posts: 14
Loc: Indiana
|
Thanks, I could not figure out "float". I didn't even think to look at measure.
Thanks,
|
Top
|
|
|
|
|
|