• Welcome to TodayPlus Boards v2.
 

News:

No news is good news.

Main Menu

var button

Started by Lordtwisted, November 21, 2003, 12:10:26 PM

Previous topic - Next topic

Lordtwisted

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

arbitrajeu

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.
[size=14]arbitrajeu[/size]
[size=12]todayplus moderator[/size]
[size=10]
iPAQ 3970, Windows Mobile 2003, 256MB SD, AgendaFusion 5[/size]

Lordtwisted

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

arbitrajeu

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... ;)
[size=14]arbitrajeu[/size]
[size=12]todayplus moderator[/size]
[size=10]
iPAQ 3970, Windows Mobile 2003, 256MB SD, AgendaFusion 5[/size]

jhollin1138

Shouldn'tif,var,var30,1,><,1beif,var,var30,1,=,1
Jim H

Lordtwisted

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]

jhollin1138

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.
Jim H