Variables scope

Discuss OrbForms Designer and PocketC Architect

Postby rogernc on Thu Apr 17, 2003 11:17 am

Hi there. I just recently purchased OrbForms and I find the product great. I have run into a few problems so I will ask the question just so I understand.

1)Does the variable declarations only work on top of a function, like C or can I declare a variable on the fly anywhere? The reason I ask is if I declare something like a Date object in the middle of my function, if I try to use a method, it tells me my date object does not exist but it works if I declare it up top.

2)Also, another thing I noticed might possibly be a bug. When I slap on a Selector object and take out the text, the selector object became super-wide and I couldn't get it smaller other than putting text in it, which brought the width back down. Is this a bug and also, through code the selector object seems to be able to be sized with the width property but I don't see a width property in the inspection box. I wasn't sure if there was a reason.

3) When I use the draw.text function to draw text on the screen, is there an easy way to erase the text? The reason I say this is that I could write the value 100 on the screen but if I next write the value 2, the 2 zeros from the 100 are still there. I fixed it by just appending blank spaces to overwrite these zeros. Is there a better way to do this? Thanks.

Posts: 10
Joined: Thu Apr 17, 2003 10:56 am

Postby dewey on Fri Apr 18, 2003 1:15 am

1) Variables must be declared at the top of functions.
2) This is a bug in the editor that will be fixed in the next release. The workaround is to just put in a space.
3) Draw a rectangle over the old text to erase it.
Site Admin
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 1 guest