Shop OBEX P1 Docs P2 Docs Learn Events
What do i do wrong? long array problems. — Parallax Forums

What do i do wrong? long array problems.

AnubisbotAnubisbot Posts: 112
edited 2009-05-08 23:32 in Propeller 1
Hi , i have a question.
I need to have a long array what holds the pins for my rgb leds. since they are all over the place.
So i have now the array and want to fill in the values byte based .

But i get a error {variable needs a operator ??}

VAR
long RGB_state[noparse][[/noparse]TableSize]
long RGBStack[noparse][[/noparse]50]
byte Manuel_Mode
long LEDS[noparse][[/noparse]8]
byte cog
PUB Start|i
 LEDS[noparse][[/noparse]0].byte [noparse][[/noparse] 0]:=4 ''red
 LEDS[noparse][[/noparse]0].byte [noparse][[/noparse] 1]:=6 ''green
 LEDS[noparse][[/noparse]0].byte [noparse][[/noparse] 2]:=8 ''blue
 LEDS[noparse][[/noparse]0].byte [noparse][[/noparse] 3]:=8 ''Placeholder 




if i use a normal long, it woks fine but as soon i have it as array it gives me this error what can i do to make it work?

Best regards Anubisbot

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-08 23:16
    You can't have a subscript on the LONG and a subscript with the .BYTE as well. What you have to do is combine the address offsets together using the .BYTE suffix like

    LEDS.byte[noparse][[/noparse] 0 ]
    LEDS.byte[noparse][[/noparse] 1 ]

    If you want the low order (first) byte of the 2nd long, do

    LEDS.byte[noparse][[/noparse] 4 ]
  • AnubisbotAnubisbot Posts: 112
    edited 2009-05-08 23:32
    Ah got you ... is see...
    Thanks
Sign In or Register to comment.