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 › programming modes
Page Index Toggle Pages: 1
programming modes (Read 563 times)
programming modes
Oct 12th, 2005, 6:37pm
 
How can I use processing in "java mode"? I need to make an array with dynamically changing length and contents. Looking through these discourses I think what I need is the java vector class, but i can find no way of switching between programming modes. Is it the same thing as using "import library - javascript"? But then I can see no way of switching between basic and continuous modes either ( I seem to be in continuous mode at the moment) so I think I must be missing something.
Re: programming modes
Reply #1 - Oct 12th, 2005, 8:18pm
 
These "modes" are just a way of programming, theres no button-push required...
You can use these libraries in every mode I believe.
What you would need it a ArrayList, which you can import via:
import java.util.ArrayList;  

read:
http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html

what you need is "add()"
Re: programming modes
Reply #2 - Oct 12th, 2005, 11:21pm
 
that's already imported by default. you can just use Vector:

Code:
Vector v;

void setup() {
v = new Vector();
for (int i = 0; i < 10; i++) {
v.add(something);
}
}
Page Index Toggle Pages: 1