the global variables are only on one side available.
It makes no difference if the variable is declared local or global.
The variable is on a new page not available.
They do work. While on page 1 call page2.mytext.txt="Hello World".
Thank you it works fine
So I have been able to use the Global Variable to perform a back button. And it works well.
What I would really love to do, without Arduino Code, is to click a Text component, stuff it's value reference into a Global variable and also stuff the current page number into another global variable. The page would switch to a keyboard, allow the user to enter a number or string, then upon clicking enter, the value would be placed back into the text component, and the page would return to where the text component resides.
In the attached example you can see I have nested back buttons working. Also pre-populating the keypad with the current value on the pages. Just need to figure out how to get the value back to the text component that was pressed.
YES,The statement of variable should be"pageNAME.cmpNAME.val or txt=".
Now I have really found a bug.
If you have too many variables on a page can not edit it all.
I missing a scrollbar!
Thus, the maximum number of variables = screen size
For better understanding I have made a picture
@Bspranger here is what your project like:Advanced Application 2: Use Global and Variable to Transmit Values Among Pages
I don't think it is too complex. you can clearly konw that every one text component is defined by a value of variable.
I have v0.35 and global variables do not seem to be working. I am using the correct syntax. Are global variables broken in this version of the editor? I also downloaded the back button example on this page and it gives me this error
Error: Invalid Page ID:page = back.val( Double click to jump to code)
Error: Compile failed! 1 Errors, 0 Warnings,
Please upload your HMI here.
A thought. When using global variables, it is best that the names of all objects should be unique (variables, components, page components) to avoid a potential object lookup collision. I can't confirm with certainty that a collision is the reason, but it is worth testing. More than 250 components per page is another limit I have yet to test, and it may be that globals defined elsewhere may add to the count. It would be interesting if any of those could be present in your project and if so, a possible contributing factor.
@Patrick I had all the globals declared with unique names. But it just would not see the variables for some reason. I did not have more that 25 components on each page but i had about a 100 small images loaded and the total size was about 3mb. I just scrapped that file and started a new file. Globals are working in that file the way they're supposed to work.