Shop OBEX P1 Docs P2 Docs Learn Events
INC Iterations for Debug — Parallax Forums

INC Iterations for Debug

DigitalDjDigitalDj Posts: 207
edited 2008-02-26 12:29 in General Discussion
I am trying to look at this through the debug window and I put this into my code but it gives me a error when compiling and says variable expected. I have looked in the help file and the SX Key and can't find anything. Can someone help on this?

Start:
  IF ctrl0 = 0 THEN
    Led0 = ~Led0
    ctrl0 = TLed0
  ELSE
    DEC ctrl0
  ENDIF

  IF ctrl1 = 0 THEN
    Led1 = ~Led1
    ctrl1 = TLed1
  ELSE
    DEC ctrl1
  ENDIF

  INC iterations

  WATCH ctrl0, 8, udec
  WATCH ctrl1, 8, udec
  WATCH iterations, 8, udec
  BREAK

  GOTO Start



Thanks,
Kevin

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Comments

  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2008-02-26 03:25
    Hello Kevin,

    Is that your whole program? Do you define iterations as variable somewhere at the beginning of your program?
  • JonnyMacJonnyMac Posts: 9,216
    edited 2008-02-26 04:15
    Indeed. In the post where I provided that debug example it states: "If you have an SX-Key then you should add a variable called iterations and watch the program flow via Debug-->Run. "
  • DigitalDjDigitalDj Posts: 207
    edited 2008-02-26 12:29
    No I ididn't create the variable!
    Ok got it my mistake!


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Sign In or Register to comment.