Shop OBEX P1 Docs P2 Docs Learn Events
assign a word variable to a byte variable in SX/B — Parallax Forums

assign a word variable to a byte variable in SX/B

GKCSGKCS Posts: 10
edited 2006-09-13 17:59 in General Discussion
Hi all,

just a "stupid" question. I have defined 2 variables, one as byte, one as word, like

v1· var byte
v2· var word

After some calculations, v2 contains a value 0<=v2<=255
Now, I like to assign the content of v2 to v1.

But the line

v1=v2 produces a SX/B error 8 "Invalide Parameter" ....

What am I missing?

Thanks in advance

Gerry

·

Comments

  • BeanBean Posts: 8,129
    edited 2006-09-13 17:17
    Gerry,
    Use "v1 = v2_LSB".
    All word variables automatically create two aliases "name_MSB" and "name_LSB".

    Bean.

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

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • GKCSGKCS Posts: 10
    edited 2006-09-13 17:59
    Hi Bean,

    thanks a bunch !!!!!!!!

    Gerry
Sign In or Register to comment.