Shop OBEX P1 Docs P2 Docs Learn Events
Two dimensional array- or something like that? Help please? — Parallax Forums

Two dimensional array- or something like that? Help please?

RforbesRforbes Posts: 281
edited 2012-12-04 07:20 in Propeller 1
Hey all,

I'm getting stumped here. I think this should be simple but it's kicking my.... uh, well... anyway. :smile:

Here's my code example
Var

  Byte Temp_0[6]   
  Byte Temp_1[6]
  Byte Temp_2[6]
  Byte Temp_3[6]
  Byte Temp_4[6]
  Byte Temp_5[6]

PUB Main | i

  repeat i from 0 to 6
   
     Temp_0[i]:= i

I'm trying to figure out how to eliminate the need to create Temp_0 thru Temp_5 as I've done above and instead use something like Temp_[6][6] ... I know this doesn't work, but I think it conveys my meaning- to create 6 arrays of 6 arrays.

If that isn't possible, I had at least hoped to be able to access the variables as I have them written by using something like this:
PUB Main|i

  repeat i from 0 to 6
   
     Temp_[i][0]:= i

And of course that doesn't work either.

Am I missing something obvious here?

Thanks in advance,
Robert

Comments

Sign In or Register to comment.