SDK Arrays

That would be the Xojo equivalent:

[code]Class myClass

Private Property mAlertINFD2() As AlertINFD2

Public Function AlertsData() As AlertINFD2
Return mAlertINFD2
End Function

Public Sub AlertsData(Assigns newValue() As AlertINFD2)
mAlertINFD2 = newValue
End Sub

End Class[/code]

[quote=291891:@Eli Ott]That would be the Xojo equivalent:

[code]Class myClass

Private Property mAlertINFD2() As AlertINFD2

Public Function AlertsData() As AlertINFD2
Return mAlertINFD2
End Function

Public Sub AlertsData(Assigns newValue() As AlertINFD2)
mAlertINFD2 = newValue
End Sub

End Class[/code][/quote]

Eli, this is fine in the IDE, but how do accomplish the same thing in the plugins SDK with my custom class? Am I approaching it completely the wrong way? The SDK doesn’t like the double parenthesis to indicate to the IDE that the property is an array.

I want to be able to assign a whole array to a class property and then be able to access those array elements via dot notation in the IDE.

I need some time away from this…going to see Inferno which opened here in Australia yesterday.

Cheers
Grant

As Joe has posted, you do not use REALproperty for this, but you use two REALmethods for the getter and the setter (as in my example).

Something along this (not tested):

[code]struct myClassStruct {
REALarray aAlertsData;
};

// Forward declarations of methods
static REALarray AlertsDataGetter(REALobject instance);
static void AlertsDataSetter(REALobject instance, REALarray newValue);

REALmethodDefinition myClassMethods[] = {
{ (REALproc)AlertsDataGetter, REALnoImplementation, “AlertsData As AlertINFD2()”, REALconsoleSafe },
{ (REALproc)AlertsDataSetter, REALnoImplementation, “AlertsData(Assigns newValue() As AlertINFD2)”, REALconsoleSafe }
};

// Method implementations
static REALarray AlertsDataGetter(REALobject instance) {
// code to return aAlertsData
}

static void AlertsDataSetter(REALobject instance, REALarray newValue) {
// code to set aAlertsData from newValue
}[/code]

Eli,

Thanks for your input. This is the way I’ll have to implement it, with a code workaround in the IDE. Thanks to Christian as well.

The only other problem is if this needs to be locked and unlocked similar to REALstrings and REALobjects. Unless it’s a REALobject, I can’t lock it…will this be a problem?

Cheers
Grant

A Xojo array is a REALobject for a plugin, so please lock it.