Concat with an object not working

I’ve stripped the issue I am having down to isolate the issue. I figure its just a data type issue and I should maybe switch to ArrayLists but… I wanted to see if anyone had a specific insight.

First off here is what I am trying to do, and it works fine with color(); vars.

color_works

here is shot of the class define and the main tab where concat is not happy.

I just checked the documentation and Object is listed as a valid type to use concat with…

thanks in advance for any help.

1 Like

Processing.org/reference/concat_.html

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[]) concat(array1, array2);.

If you dislike using the (cast) operator for concat() I can write for you a version that doesn’t need it like I did for append():

1 Like

Thanks for sharing this question!

When possible, please paste code as text rather then as screenshots. Error messages and warnings can also be cut-pasted by clicking on the error bar.

1 Like

Jeremy, Ah yes I understand, sorry about that.

Thank you GoTo, I did go the casting route and its working great.

Cheers!

Toof