Programming Statements

Moderator: Moderator Group

Programming Statements

Postby yana » Fri Jan 09, 2015 10:16 am

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.
Thanks
yana
 
Posts: 7
Joined: Thu Sep 13, 2012 9:38 am

Re: Programming Statements

Postby Daniel Kaminski » Fri Jan 09, 2015 2:33 pm

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
--
Daniel Kaminski
Pandoras Box Expert
User avatar
Daniel Kaminski
 
Posts: 1071
Joined: Tue Jul 22, 2008 10:55 am
Location: Herten, Germany


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 12 guests

cron