Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 465

Help with clamping a variable

$
0
0
I'm trying to use a variable as a page number, but not sure I've set it up right using the Clamp function, or maybe my String Measure is at fault?

Code:

[Variables]PageNo=1PageBkIcon=[\xE760]PageFwdIcon=[\xE761][mPage]Measure=StringString=#PageNo#IfMatch=1IfMatchAction=[!ShowMeterGroup Page1][!UpdateMeterGroup Page1][!Redraw]IfNotMatchAction=[!HideMeterGroup Page1][!UpdateMeterGroup Page1][!Redraw]IfMatch2=2IfMatchAction2=[!ShowMeterGroup Page2][!UpdateMeterGroup Page2][!Redraw]IfNotMatchAction2=[!HideMeterGroup Page2][!UpdateMeterGroup Page2][!Redraw]IfMatch3=3IfMatchAction3=[!ShowMeterGroup Page3][!UpdateMeterGroup Page3][!Redraw]IfNotMatchAction3=[!HideMeterGroup Page3][!UpdateMeterGroup Page3][!Redraw]IfMatch4=4IfMatchAction4=[!ShowMeterGroup Page4][!UpdateMeterGroup Page4][!Redraw]IfNotMatchAction4=[!HideMeterGroup Page4][!UpdateMeterGroup Page4][!Redraw]IfMatch5=5IfMatchAction5=[!ShowMeterGroup Page5][!UpdateMeterGroup Page5][!Redraw]IfNotMatchAction5=[!HideMeterGroup Page5][!UpdateMeterGroup Page5][!Redraw]DynamicVariables=1[sPageBk]FontSize=12FontColor=#Yellow#Text=#PageBkIcon#[sPageFw]FontSize=12FontColor=#Yellow#Text=#PageFwdIcon#[PageBkIcon]Meter=StringMeterStyle=sAllIcons | sPageBkLeftMouseUpAction=[!SetVariable #PageNo# "(Clamp(#PageNo#-1,1,5))"][!UpdateMeasure mPage][!Redraw]X=100Y=496[PageText]Meter=StringMeterStyle=sGlobalTextText=Page #PageNo#X=10RY=r[PageFwdIcon]Meter=StringMeterStyle=sAllIcons | sPageFw | sHighlightLeftMouseUpAction=[!SetVariable #PageNo# "(Clamp(#PageNo#+1,1,5))"][!UpdateMeasure mPage][!Redraw]X=10RY=r
Thanks :thumbup:

Statistics: Posted by sl23 — Yesterday, 3:01 pm — Replies 5 — Views 83



Viewing all articles
Browse latest Browse all 465

Trending Articles