Re: Variables not read ! [solved (but with a workaround)]
-
I'm in the process of building a menu out of textobjects.
To align te text I use a variable.
In this example de variable Topstart has the value 50When I use it to orient text objects onto the map
they all should be on the same line/height but they don't. Only the first object respects the variable al the others don't!! I don't get is when I put 50 in it works just fine.This is what I have so far:
-
I don't understand what is the problem exactly, but I think that you need to be aware of the first two options in "Draw... " blocks. Notice the names of the objects, they have "1" appended to their name: http://prntscr.com/866lbv
Those 2 options control the way objects are created and then modified by the block. 2 options with 2 states each = 4 possible configurations. But I will better create some example for this, because now I am working on the examples anyway... -
Its simple
I have some text objects. I place them on the map with x y coords.
When I fill i the xy coords with regular numbers it works fine. When i replace the numbers for y with a variable, only the first respects the variable and the rest just of the objects don't anymore, no matter what I do. I think its a bug. Yesterday I experimented with variables and text-object placement it is repeated over and over again.
I want to use variables for easy adjustments etc.
The example still counts. Put it one the chart.
In oninit the objects are created the variable "TopStart=50" should place the 3 objects at 50 pixels from the top. (All on the same line but that doesn't matter for now.) But it doesn't. When I do use integer numbers for Y it works just fine. But I don't want to use numbers I want to use variables
Place it on the chart and you see some text object on the chart. first on accepts the variable for y the next one doesn't. it places the text on the top of the screen. the third also.
the fourth object should be discarded. -
Something wrong happens when the original value of that parameter where the variable is used contains the name of that variable
-
I think it's ok now
-
It is solved: I declared the variables as int and that doesn't work
When I declare the variables as a doubles it works fine.Strange that I have to use a double for an integer value. Since doubles uses more memory than integers. That might be a bug
For now I will use doubles all over the place to avoid this problem.
-
More memory... this is not a microcontroller with 64k of memory. Even if you define 1000 more variables, there will be no difference for today's memory sizes. And each generated EA contains many more functions and variables compared to some that is manually programmed.