TodayPlus Boards v2

TodayPlus for the Pocket PC Forums => Help and Support => Topic started by: Lordtwisted on November 21, 2003, 12:10:26 PM

Title: var button
Post by: Lordtwisted on November 21, 2003, 12:10:26 PM
how can i change a var with a button, like this:storevar,var30=1

             if,var,var30,1,><,1
               imagebutton,23,30,down_arrow.png,t,-1,6,var30=2,9
               //button,23,30,15,10,-1,9,var30=2
               text,23,30,bla,l
               else

           
              text,23,30,bla,l
               imagebutton,23,30,down_arrow.png,t,-1,6,var30=1,9
               //button,23,30,15,10,-1,13,var30=1

endif

the buttons wont change it?


Thanks lordtwisted
Title: var button
Post by: arbitrajeu on November 21, 2003, 12:19:10 PM
I think the problem is with the storevar.  This is setting the value of var30 to 1, then you are checking the if, which will always evaluate to TRUE (because you just set var30 to 1) then the imagebutton will set var30 to true and refresh the region.  TodayPlus always works from the top, so when the region refreshes, the storevar sets var30 from 2 to 1, the if evaluates to TRUE and you're back where you started.

I think you need to replace the storevar with an initvar:

initvar,var30,1
which is only processed when the skin is loaded.
Title: var button
Post by: Lordtwisted on November 21, 2003, 12:24:49 PM
QuoteI think the problem is with the storevar. This is setting the value of var30 to 1, then you are checking the if, which will always evaluate to TRUE (because you just set var30 to 1) then the imagebutton will set var30 to true and refresh the region. TodayPlus always works from the top, so when the region refreshes, the storevar sets var30 from 2 to 1, the if evaluates to TRUE and you're back where you started.

I think you need to replace the storevar with an initvar:

arbitrajeu,

i have tried that but it dosent change it. i think my buttons are not right i don't know, it is in region 9 subregion 8 region 9 is set to update every 10 and region 8 is set to update -1. im lost.

lordtwisted
Title: var button
Post by: arbitrajeu on November 21, 2003, 12:40:35 PM
Quote from: Lordtwistedi think my buttons are not right i don't know, it is in region 9 subregion 8 region 9 is set to update every 10 and region 8 is set to update -1. im lost.
Feel free to post your skin and I'll take a look.  Sometimes a fresh pair of eyes just helps - and there's a chance srs has already fixed your problem, in that disturbing manner of his... ;)
Title: var button
Post by: jhollin1138 on November 21, 2003, 12:47:34 PM
Shouldn'tif,var,var30,1,><,1beif,var,var30,1,=,1
Title: var button
Post by: Lordtwisted on November 21, 2003, 01:05:09 PM
jhollin1138;

[/quote][/code]Shouldn'tCode:
if,var,var30,1,><,1
beCode:
if,var,var30,1,=,1
[quote]

you can use it like this:
if,var,var30,1,><,1
or like this:
if,var,var30,,=,1


arbitrajeu,


Thanks bro, i found out what was wrong:
imagebutton,23,30,down_arrow.png,t,-1,6,var30=2,9
where at the end i was udating the wrong region, 9 instead of 8. Duhhhh. :lol:


Lordtwisted[/quote]
Title: var button
Post by: jhollin1138 on November 21, 2003, 01:11:54 PM
After I posted my help, I know something wasn't right.  I have hard time with the "if,then,else" format of TodayPlus.  Glad to see you got it working.