-->
Page 3 of 3

Re: V1.13: problems with timer function

PostPosted: Wed Nov 04, 2015 4:01 am
by Mmiscool
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.

Re: V1.13: problems with timer function

PostPosted: Wed Nov 04, 2015 2:08 pm
by matherp
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

Re: V1.13: problems with timer function

PostPosted: Wed Nov 04, 2015 5:38 pm
by Mmiscool
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

Re: V1.13: problems with timer function

PostPosted: Wed Nov 04, 2015 5:55 pm
by matherp
THANKS!!!!

I'll study these more tomorrow. There is something about web programming I can't get my head round. Give me hardware registers, interrupts and assembler everytime :D