johnsojc wrote:Alas, I have found another bug in xAgeSDLBoolRespond.py. It occurs when you are viewing one particular screen on the control imager in Er'cana (the one where you can see the grinding wheels). On switching to that screen, value become 2 when it should only be 0 or 1. This make the tuple index go out of range and triggers a traceback.
[..]Once this happens, none of the control buttons on any screen will display. The 4th, 5th, 6th and 7th lines above are print statements I added to try to figure out what is going on.
My first theory is that in the old script, the test is if value is TRUE. an integer value of 2 returns TRUE in if ageSDL[stringVarName.value][0]:. Your script uses the integer value of ageSDL[sdlName.value][0] as an index. On the one screen, ageSDL[sdlName.value][0] returns the value 2.
[..] I put my hack in after the PtDebugPrint() so the actual value of ageSDL[sdlName.value][0] is displayed.
I must say I'm impressed by your detective work, and how carefully you avoid to cause other issues. Especially when I read the last sentence. That proves you're thinking about what you do. You're doing a good job here.