Page 1 of 1

Programming Statements

PostPosted: Fri Jan 09, 2015 10:16 am
by yana
Hi,

I have some questions regarding the if else statements and also the loop script.

How and when will i use this statements in my widget programming and how do i write it in the widget. Using the Node programming.

The intent is to have a variable, example i, and i goes from 0 to 3 and resets (auto or manually) back to 0 after hitting max value of 3.

We want to count the number of times a pushbutton is pressed. First time … do something. 2nd time do something else, etc.

Re: Programming Statements

PostPosted: Fri Jan 09, 2015 2:33 pm
by Daniel Kaminski
Hi,

you do not need nodes at all.
All you need to do is create a Variable of Type Interger and call it pushcount and count it up:
Also create a label to see the example working.

Example

Code: Select all
pushcount += 1

Select Case pushcount
Case 1
{
label1.text = Count is 1
}
Case 2
{
label1.text = Count is 2
}
Case 3
{
label1.text = Count is 3 and will be resetet to 0
pushcount = 0
}
End Select