Home AMX User Forum AMX General Discussion

Button tracking

Hello all
I'm not sure if its the 22 hrs of jamming code or the case of coke I've emptied but I'm having trouble getting a TP button to follow the state of a variable. The varible is the result of pharsing a buffer from a DM84. The variable is switching to match the feedback from the DM84 (watching it in the debug window) but the button refuses to change states or will turn on once and stay there. I have something like this(I'll load the code later) but basically it is:
Send_string dvDM84,(request input # mute status)
find_string dvDM84_buffer(ok,1)
junk=remove_string(ok,1)
mute_status=(number left from junk, either a 0 or 1)
[VTP,212]=mute_status

I've tried to use 'if' statements to turn on or off based on the result of mute_status being 0 or 1 but it didn't want to work either, any idea's would be greatly appreciated. Night all.

Comments

  • Spire_JeffSpire_Jeff Posts: 1,917
    It's early, but the only thing I can think of is that mute_status is being treated as an ASCII value in which case 0 and 1 are both <> 0. Are you doing an ATOI() operation on the remaining character?

    Just a thought.
    Jeff
  • yuriyuri Posts: 861
    check mute_status in your debug window,
    does it actually change?
  • It's all working now, After a few hours of Zzzzzz's I found my error(Jeff, you were very close to the problem and once you mentioned it, the problem popped right out at me.)

    P.S. The debug showed the value changing with each push but the button didn't. Amazing how the simple things can stump you when your tired.
  • Spire_JeffSpire_Jeff Posts: 1,917
    I think the biggest mistake I made was on the last day of a marathon programming session out of town doing a system takeover/upgrade. It's a long story, so I won't bore anyone with the details, but the last thing I had to fix before I could leave for the night was the fact that the favorite channel buttons weren't functioning properly on when I would do a push and hold. The should have popped up a popup to let me set the favorite, but it just wasn't happening. I was double checking my code (even tho it was functioning in other jobs). I was monitoring communication and button pushes. I even went into debug and it seemed that the code wasn't even reacting to the button events. Well, eventually, I figured out that I had commented out the include file that declared the module and set the variables :) So, the reason it wasn't working was because I told it not to ;)

    It took me few hours to figure it out and about another hour to stop myself from banging my head into the wall :) Glad you figured it out Thomas.

    Jeff
Sign In or Register to comment.