Typed REALarray

I assume there is no possibility to create a typed REALarray (based on a REALclass defined in the same plugin)?

Inside as far as C++ is concerned then its REALobject. But outside as you define it in your Interface you can for example say its array of cars.

So in short yes you can make them typed.

It does not work. This is what I have:

REALmethodDefinition ModuleArrayMethods[] = { { (REALproc)SomeFunction, REALnoImplementation, "SomeFunction() As Car()", REALconsoleSafe } };

static REALarray SomeFunction() { ... REALarray retval = REALCreateArray(kTypeObject, -1); ... // append Car elements return retval; }

I have my own types for arrays depending on the types.

static REALarrayObject SomeFunction() { ... REALarrayObject retval = REALCreateArrayObject(); ... // append Car elements return retval; }

This makes sure I don’t accidentally return the wrong array type.

[quote=286014:@Eli Ott]It does not work. This is what I have:

REALmethodDefinition ModuleArrayMethods[] = { { (REALproc)SomeFunction, REALnoImplementation, "SomeFunction() As Car()", REALconsoleSafe } };

static REALarray SomeFunction() { ... REALarray retval = REALCreateArray(kTypeObject, -1); ... // append Car elements return retval; }[/quote]

What exactly do you get ? I don’t see anything wrong in your code there but then again you don’t show how your appending the objects so I guess you might be getting empty Array if your appending wrong.

[quote=286014:@Eli Ott]It does not work. This is what I have:

REALmethodDefinition ModuleArrayMethods[] = { { (REALproc)SomeFunction, REALnoImplementation, "SomeFunction() As Car()", REALconsoleSafe } };

static REALarray SomeFunction() { ... REALarray retval = REALCreateArray(kTypeObject, -1); ... // append Car elements return retval; }[/quote]

This looks correct at first glance. What do you mean by “does not work”?

@Norman Palardy He wants to return an array, so the extra () is right.

Oh duh wants to return an array of cars from the function so … yeah it look right and my suggestion is wrong