We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Array Properties
Page Index Toggle Pages: 1
Array Properties? (Read 736 times)
Array Properties?
Apr 28th, 2010, 6:39am
 
Hello everyone, I am relatively new to the processing community and I have tried searching many different things but I can't seem to find anything on it. But anyway I was wondering if processing had any way of doing something like:

Code:
int[] name = {x:100, y:100} 



Where there are x and y (for example) that has a value and can be accessed like:

Code:
println(name.x) 



I know you could probably make a class to do that but I was just curious.
Re: Array Properties?
Reply #1 - Apr 28th, 2010, 6:53am
 
Well, that's the syntax used in several languages, including JavaScript and JavaFX, but that's not possible in Processing/Java.
As you guessed, you have to use classes for such things.
Re: Array Properties?
Reply #2 - Apr 28th, 2010, 1:56pm
 
ok thank you Smiley
Page Index Toggle Pages: 1