| View previous topic :: View next topic |
| Author |
Message |
Pat1487
Joined: 08 Jan 2007 Posts: 59
Digg It |
Posted: Mon Jan 22, 2007 4:18 pm Post subject: Arrays and variable indexes? |
|
|
lets say i want to do this
| Code: | if key.A then
var.i =0
while var.i<0{
var.a[var.i]=var.a[var.i]*2
var.i = var.i + 1
}
endif
debug = var.a[0] + ' '+ var.a[2] + ' ' + var.a[9]
|
It says "array index expected" on the line with var.a[var.i]=var.a[var.i]*2.
Can you not use variables as indexes for arrays?
or have i not done something correctly? |
|
| Back to top |
|
 |
TylerK

Joined: 18 Dec 2006 Posts: 384 Location: Springfield, IL
Digg It |
Posted: Mon Jan 22, 2007 6:44 pm Post subject: |
|
|
| There are no arrays in GlovePIE. |
|
| Back to top |
|
 |
Pat1487
Joined: 08 Jan 2007 Posts: 59
Digg It |
Posted: Mon Jan 22, 2007 7:19 pm Post subject: |
|
|
oh
thats weird that the error would say that then
i hope future versions of glovepie support arrays |
|
| Back to top |
|
 |
TylerK

Joined: 18 Dec 2006 Posts: 384 Location: Springfield, IL
Digg It |
Posted: Mon Jan 22, 2007 8:54 pm Post subject: |
|
|
| You and me both! I think it would allow for some clever scripting. |
|
| Back to top |
|
 |
deceased Site Admin

Joined: 11 Dec 2006 Posts: 287 Location: Aurora, ON
Digg It |
Posted: Mon Jan 22, 2007 9:01 pm Post subject: |
|
|
There's a Java lib being released soon (hopefully) that you might want to check out. Obviously, you'd be able to use arrays and anything else already in Java. And, Java is cross platform. You might want to check that out if you're fluent in Java. I certainly will.
However, I think there's a specific reason why arrays didn't work so well in GlovePIE, because it seems reasonable that they'd be implemented already. Maybe Carl could shed some light on this... _________________ -deceased-
Wiili - a gnu revolution |
|
| Back to top |
|
 |
MacD
Joined: 15 Jan 2007 Posts: 13
Digg It |
Posted: Tue Jan 23, 2007 11:03 am Post subject: |
|
|
There's already a c library released for the wiimote, somewhere. But using Java or C is slightly more complicated to integrate than just using GlovePIE.
And I third the opinion that matrices/arrays would be a good thing to have in GlovePIE  |
|
| Back to top |
|
 |
|