Shop OBEX P1 Docs P2 Docs Learn Events
WORD arrays in SXB OK? — Parallax Forums

WORD arrays in SXB OK?

PJAllenPJAllen BannedPosts: 5,065
edited 2009-07-18 21:45 in General Discussion
section··VAR· WORD(5)
--> INVALID NUMBER OF PARAMETERS

Comments

  • JonnyMacJonnyMac Posts: 9,213
    edited 2009-07-18 17:16
    SX/B has never supported arrays of Words. What do you want to do, specifically?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-07-18 17:38
    Well, that's that --·I'll have to do it in two bytes then.· It'd be nip_&-tuck with a WORD array.

    [noparse][[/noparse] How do you eat an elephant?· One byte at a time! ]
  • JonnyMacJonnyMac Posts: 9,213
    edited 2009-07-18 21:45
    Depending on what you need the code to do you can define words within an array:

    temps           VAR     Byte (8)
     tmpW1          VAR     Word @ temps(0)
     tmpW2          VAR     Word @ temps(2)
     tmpW3          VAR     Word @ temps(4)
     tmpW4          VAR     Word @ temps(6)
    


    To use them like normal variables, though, you have to use BANK @temps, run your code, and then use BANK to get back to the "normal" variables bank. Again, it just depends on what you're wanting to do.
Sign In or Register to comment.