Rules: Multiple IF statements?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
waspie
Normal user
Posts: 127
Joined: 09 Feb 2017, 19:35

Rules: Multiple IF statements?

#1 Post by waspie » 01 Jun 2018, 13:52

I can't find anything that states whether you can have multiple IF statements or not. I'm not trying to nest them, just having more than one in a rule.
With a Nextion, a button press = a number. If you have lots of buttons it would be nice to have one rule to intercept the press and then spin off all the events based on whatever number it is.

Code: Select all

on Nextion#button do
if Nextion#button=1 
event,blahblah
endif
if Nextion#button=2
event,blah
endif
if Nextion#button=3
event,blah3
endif
if Nextion#button=4
event,blah4
endif
endon

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Rules: Multiple IF statements?

#2 Post by grovkillen » 01 Jun 2018, 16:33

Yes you can use this but it might not be as responsive as you like. The loop will have to run multiple runs to go through the list.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

waspie
Normal user
Posts: 127
Joined: 09 Feb 2017, 19:35

Re: Rules: Multiple IF statements?

#3 Post by waspie » 01 Jun 2018, 17:17

grovkillen wrote: 01 Jun 2018, 16:33 Yes you can use this but it might not be as responsive as you like. The loop will have to run multiple runs to go through the list.
yeah that's fine, i'm just trying different things to see what's going to work best for me. thanks for letting me know.

I'm new to using the nextion and want to make this work as well as I can.

danmero
Normal user
Posts: 64
Joined: 11 May 2017, 01:19

Re: Rules: Multiple IF statements?

#4 Post by danmero » 03 Jun 2018, 12:03

You can try

Code: Select all

on Nextion#button do 
	event,blah[Nextion#button]
endon

On blah1 do
   # do something
endon

Use button value to create the event name

Regards,

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 36 guests