-->
Page 1 of 1

Variable branching and UDP

PostPosted: Thu Sep 15, 2016 4:22 pm
by Electroguard
The listbox variable branching example works great, so I tried extending the principle to allow conditional branching depending on received udp msgs of [test1] or [test2] etc.

That also works great, but it threw up an awkward usage conflict... the udpbranch [branch] requires terminationg it's subroutine with a 'return' in order to receive another incoming udp msg, but that means that you can't 'wait' in any other subroutines for any other events.

But almost every event other than udp requires a 'wait' - so although a udp msg can cause a 'variable' branch to different subroutines, it can't actually do anything in them which needs to end in a 'wait', else the udpbranch is never returned to for receiving any more udp msgs.

So... would it be possible to somehow modify the udpbranch 'return' into a 'wait' to make it compatible with other event handling?

Re: Variable branching and UDP

PostPosted: Thu Sep 15, 2016 8:36 pm
by Mmiscool
Why not set a flag variable and have the timer branch check every second or so?

Re: Variable branching and UDP

PostPosted: Fri Sep 16, 2016 4:36 am
by Electroguard
Why not set a flag variable and have the timer branch check every second or so?

Sorry Sir, but I don't understand what is being suggested ... what should the frequently checked variable be flagging up?

The timer instruction itself needs to be sat 'wait'ing for its events, so wouldn't that prevent the udpbranch subroutine issuing a 'return' in order for the udpbranch to start looking again for new incoming udp msgs?