Shop OBEX P1 Docs P2 Docs Learn Events
SX/B: WATCH an array element? — Parallax Forums

SX/B: WATCH an array element?

PaulPaul Posts: 263
edited 2006-08-16 19:13 in General Discussion
I'm trying to WATCH an array element (in SX/B 1.51) defined as follows:

ADC··var byte(8)
The 'new'·format·didn't work:
·Watch ADC(0)
It 'compiled' to: ADC+0,8,UDEC which reported an error on the "Invalid type '8'

This didn't work either:
·WATCH ADC(0),8,UDEC
It has an "invalid type ','

This·compiles but I suspect it is only looking at ADC(0):
·watch ADC,8,UDEC

How·would I WATCH ADC(1) thru ADC(7)?

Thanks,
Paul

·

Comments

  • BeanBean Posts: 8,129
    edited 2006-08-16 18:55
    Paul,

    It seems the WATCH command in SASM doesn't like the "+" sign.

    You can make it work by creating an alias to the individual elements, and watch them.

    adc  VAR BYTE (8)
    adc0 VAR adc(0)
    adc1 VAR adc(1)
    adc2 VAR adc(2)
     
    WATCH adc0
    WATCH adc1
    WATCH adc2
    

    Or if you want to see the array as a string you can use WATCH ADC,8,FSTR in this case the "8" is the number of elements in the array.

    I will look into correcting this for the next release...

    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com

    "You're braver than you believe, stronger than you seem, and smarter than you think" Christopher Robin to Pooh
    ·
  • PaulPaul Posts: 263
    edited 2006-08-16 19:13
    Thanks Bean! The Alias will work for now.

    Paul
Sign In or Register to comment.