Report Bugs Here

Moderator: Mmiscool

User avatar
By Mmiscool
#33006 The timer is intended for timing on the device.
Not for timing in the browser.
The htmlvar() will make it so that if page is refreshed it will refresh with contents of variable.
If you hit the refresh button in the browser you will see the new values as they are updated.
User avatar
By matherp
#33044 I'm still missing something

Code: Select allai testit
wprint htmlvar(testit)
button Exit [TestExit]
wait
[TestExit]
end


Based on what you say above whenever I refresh the page I should see a new version of testit but I don't.

Please could anyone let me have a simple code example that allows me to see the new value of an input preferably when I press a button but worse case when I refresh the page
User avatar
By Mmiscool
#33066 There are 2 ways to solve your problem.

The first way is to make your program like the following.
Notice how when you click the button it goes to the top of your program, Clears the screen and redraws all the html from scratch.
Code: Select all[top]
cls
ai testit
wprint testit
button "Redaw entire page" [top]
button Exit [TestExit]
wait
[TestExit]
end



The second example here will update the value in the page dynamically and dd some more information at the bottom of the page.
Code: Select allcls
ai testit
wprint htmlvar(testit)
button "Do Some thing else" [branch]
button Exit [TestExit]
wait
[TestExit]
end


[branch]
wprint "<hr>"
wprint "I just did the action for the button"
ai testit      'updating that variable with latest analog in
wait