Shop OBEX P1 Docs P2 Docs Learn Events
PUT command with a constat value — Parallax Forums

PUT command with a constat value

SamTheManSamTheMan Posts: 43
edited 2009-06-17 15:13 in General Discussion
Dear Bean,

I tried this code, but I had a problem with it.
the X array gets filled up with 5s instead of the first 5 locations only
please note the compiler did not complain
Thank you for your great effort.

p con 10
x var byte(16)
y var byte(16)
a var byte (16)

i var byte


for i=0 to 15
y(i)=5
next


put a,y(0) TO y(p)· 'OK
put x,y(0) TO y(p-5)· ' DOES NOT work right and the compiler did not complain


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

Comments

  • BeanBean Posts: 8,129
    edited 2009-06-17 15:13
    Sam,
    You can only use math in an assignment command (even constant math).
    So the y(p-5) should have thrown an error. I'll look into it.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There is a fine line between arrogance and confidence. Make sure you don't cross it...

    ·
Sign In or Register to comment.