WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Arrays and variable indexes?

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie
View previous topic :: View next topic  
Author Message
Pat1487



Joined: 08 Jan 2007
Posts: 59

Digg It
PostPosted: 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
View user's profile Send private message
TylerK



Joined: 18 Dec 2006
Posts: 384
Location: Springfield, IL

Digg It
PostPosted: Mon Jan 22, 2007 6:44 pm    Post subject:

There are no arrays in GlovePIE.
Back to top
View user's profile Send private message
Pat1487



Joined: 08 Jan 2007
Posts: 59

Digg It
PostPosted: 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
View user's profile Send private message
TylerK



Joined: 18 Dec 2006
Posts: 384
Location: Springfield, IL

Digg It
PostPosted: 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
View user's profile Send private message
deceased
Site Admin


Joined: 11 Dec 2006
Posts: 287
Location: Aurora, ON

Digg It
PostPosted: 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
View user's profile Send private message
MacD



Joined: 15 Jan 2007
Posts: 13

Digg It
PostPosted: 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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group