Shop OBEX P1 Docs P2 Docs Learn Events
2d arrays — Parallax Forums

2d arrays

zmasterfunzmasterfun Posts: 14
edited 2008-04-26 19:00 in BASIC Stamp
How do i make 2d arrays·on basic stamp 2·i did this but compilation fails...

map VAR Word(2,2)

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-04-26 14:57
    Examples --

    trial_1·· VAR· Byte(2)
    trial_2·· VAR· Word(2)

    the bytes/words available are trial_1 (0) and trial_1 (1); trial_2(0) and trial_2 (1)
  • zmasterfunzmasterfun Posts: 14
    edited 2008-04-26 15:17
    I know that, but can you make a 2d array like in c++ or visual basic.
    In visual basic.net declaration would look like:

    dim variable(2,2) as integer

    How would i do the equivelent in BASIC stamp editor?
  • tpw_mantpw_man Posts: 276
    edited 2008-04-26 15:51
    You cannot make a 2D array directly. There are various solutions that you can use to 'emulate' a 2D array like the one PJ Allen posted, as well as other methods.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I am 1010, so be surprised!
  • zmasterfunzmasterfun Posts: 14
    edited 2008-04-26 19:00
    ok, Thank you
Sign In or Register to comment.