unexpected result HELPPP
avi_dave
Posts: 62
somebody please help me with this block
[php]
(*Micz 1 - 8 Mute ON/OFF TOGGLE*)
case 87:(*Mics 1*)
case 88:(*Mics 2*)
case 89:(*Mics 3*)
case 90:(*Mics 4*)
case 91:(*Mics 5*)
case 92:(*Mics 6*)
case 93:(*Mics 7*)
case 94:(*Mics 8*)
{
local_var integer nChanID
local_var integer nMicMuteStatus[8]
local_var integer nMicStatLoop
nChanID = (button.input.channel - 183)
for(nMicStatLoop=1;nMicStatLoop<=8;nMicStatLoop++)
if (nMicMuteStatus[nMicStatLoop] = 0)
{
AddtoNexiaQue("'SET 1 FDRMUTE',' ',itoa(nChanID),' ',itoa(nChanID),' ','1',$0A,$FF")
nMicMuteStatus[nChanID] = 1
}
else if (nMicMuteStatus[nMicStatLoop] = 1)
{
AddtoNexiaQue("'SET 1 FDRMUTE',' ',itoa(nChanID),' ',itoa(nChanID),' ','0',$0A,$FF")
nMicMuteStatus[nChanID] = 0
}
}
}
[/php]
it runs through all 8 I only need 1 if event happened, what am i over looking?
[php]
(*Micz 1 - 8 Mute ON/OFF TOGGLE*)
case 87:(*Mics 1*)
case 88:(*Mics 2*)
case 89:(*Mics 3*)
case 90:(*Mics 4*)
case 91:(*Mics 5*)
case 92:(*Mics 6*)
case 93:(*Mics 7*)
case 94:(*Mics 8*)
{
local_var integer nChanID
local_var integer nMicMuteStatus[8]
local_var integer nMicStatLoop
nChanID = (button.input.channel - 183)
for(nMicStatLoop=1;nMicStatLoop<=8;nMicStatLoop++)
if (nMicMuteStatus[nMicStatLoop] = 0)
{
AddtoNexiaQue("'SET 1 FDRMUTE',' ',itoa(nChanID),' ',itoa(nChanID),' ','1',$0A,$FF")
nMicMuteStatus[nChanID] = 1
}
else if (nMicMuteStatus[nMicStatLoop] = 1)
{
AddtoNexiaQue("'SET 1 FDRMUTE',' ',itoa(nChanID),' ',itoa(nChanID),' ','0',$0A,$FF")
nMicMuteStatus[nChanID] = 0
}
}
}
[/php]
it runs through all 8 I only need 1 if event happened, what am i over looking?
0
Comments
Jeff
The only other thing I can see is that you are talking about the first Case statements. If you don't want mics 1-7 to hit the code, you need to either remove them from the code, or make them do nothing like such:
This is actually a feature that it lets you declare multiple cases for the same block of code.
Jeff
Is your entire switch/case in a FOR loop? Can you give more details on exactly what is happening 8 times?
I agree that the CASE: stack (and other stacks available for us to use) are bizzare. But, I hope they keep them. I do use them all the time. I wish they were allowable in some other languages I have to peck through.
Unless I'm misunderstanding he actually wants all of the cases to trigger the same code block.
I agree, I hope they keep this "feature" as I use it quite often.
if mic 5
or the longer way I gave up grrrrrr
And don't put comments in your braces cuz that really messed with my head!
I have never had an issue using = where == is technically correct. Anyone else?
I've started trying to use == because it is the proper way, and it can also make the code easier to read - especially with things like