switch/case/wait
filpee
Posts: 64
The following code doesnt work. It seems that the switch/case statement doesnt work inside the wait.
Strange though that if I change it to select/active it will work.
I tried assigning 'mode' to a local var but that didnt work either.
I suppose there is a perfectly valid reason why this doesnt work. I'll have to make sure I dont get caught on it next time.
Strange though that if I change it to select/active it will work.
I tried assigning 'mode' to a local var but that didnt work either.
I suppose there is a perfectly valid reason why this doesnt work. I'll have to make sure I dont get caught on it next time.
define_function systemStartup (char mode) //1=standard, 2=recorded, 3=video conf { switch(mode) { case 1:{ //standard send_string 0,"'First switch - case = 1'"; } case 2:{ //recorded send_string 0,"'First switch - case = 2'"; } case 3:{ //video conf send_string 0,"'First switch - case = 3'"; } default:{ send_string 0,"'First switch - case defaulted'"; } } if (systemStatus = systemIsOff) { switch(mode) { case 1:{ //standard send_string 0,"'2nd switch - case = 1'"; } case 2:{ //recorded send_string 0,"'2nd switch - case = 2'"; } case 3:{ //video conf send_string 0,"'2nd switch - case = 3'"; } default:{ send_string 0,"'2nd switch - case defaulted'"; } } systemStatus = systemIsOn; } else { wait 30{ switch(mode) { case 1:{ //standard send_string 0,"'3rd switch - case = 1'"; } case 2:{ //recorded send_string 0,"'3rd switch - case = 2'"; } case 3:{ //video conf send_string 0,"'3rd switch - case = 3'"; } default:{ send_string 0,"'3rd switch - case defaulted'"; } } systemStatus = systemIsOff; } } }
Assign Stack Ref Error - Out of Range CHeap::Delete - ERROR(2) Attempting to delete invalide block 3rd switch - case defaulted
0
Comments
There is no valid reason that I?m aware of. It's just one of the switch/case ?undocumented features.?
Correct me if I'm wrong, but isn't Select/Active a structure exclusive to NetLinx? I've never seen it in any other language, and Google is coming up empty as well.
Incorrect output when Button 1 is pushed:
Correct output when Button 2 is pushed: