window.stop()
for i=0,6 do
btnBit = (panelBtns >> i) & 0x01
toggles[FVAL][i] = (btnBit * 127)
if (toggles[FVAL][i] == 127) then
toggleText = toggles[NAME][i] .. " ON"
btnColor = BRIGHTGREEN
else
toggleText = toggles[NAME][i] .. " OFF"
btnColor = WHITE
end
toggles[CNTL][i]:setColor(btnColor)
toggles[CNTL][i]:setName(toggleText)
end
window.resume()
FVAL, NAME, CNTL are #defines used for the 2-dimensional array indexing.
CNTL[n] holds the controlId for various on screen momentary pads.
When this code runs, it always sets the color properly but the name is NEVER set.
This code is in a function being called at the end of patch.onResponse()
Looking over my code, it seems to be some timing conflict between one place where I get some values and the calls to the format() functions for each of the controls.
It appears the format() function is using values from the parameterMap before I have them properly set, so the name gets overwritten with the default.
I am restructuring the sequencing of my operations to clean that up.
BTW - I didn’t at first think it was an OS problem, but you know, my code is always correct, so what other option was there?