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 › apend in array of objects
Page Index Toggle Pages: 1
apend in array of objects (Read 211 times)
apend in array of objects
Oct 25th, 2008, 3:26am
 
why can´t I do this, when I want to create another object

myClassName[] myClass = new myClassName[0]; // it starts with no object on it

myClass = append(myClass, b); // this triggers an error

the thing I can do is set the maximum numbers of objects from start, and create a Boolean variable named isActive inside the class, but I don´t want all the other objects to exist simultaneously yet.

is there any way to increase the number of indexes of an array of an object?
Re: apend in array of objects
Reply #1 - Oct 25th, 2008, 10:11am
 
from the reference..
"When using an array of objects, the data returned from the function must be cast to the object array's data type. For example: SomeClass[] items = (SomeClass[]) append(originalArray, element)."

Page Index Toggle Pages: 1