SubscribeToUserPropertyByType
Subscribes to event callback for changes of a component user defined property.
🔁 Function
void SubscribeToUserPropertyByType (
property: string,
componentName: string,
componentTypeName: string,
callbackName: string);
or
void SubscribeToUserPropertyByType(
property: string,
componentName: string,
componentTypeName: string,
callbackName: object);
⚙️ Parameters
Name | Type | Description |
---|---|---|
property |
String | The name of the property to subscribe to |
componentName |
String | The name of the component to subscribe to |
componentTypeName |
String | The type of the component. See options |
callbackName |
Object | Can be a string (The name of the callback function) or the callback function itself |
↩️ Return Value
None
Callback Definition
void xxxxxxxxxxxxx(sender: object, property: string)
Name | Type | Description |
---|---|---|
sender |
Object | The object whose property changed. |
property |
String | The name of the user property that has changed. |
📝 Example
SubscribeToUserPropertyByType("UP1", "Conveyor1", "Conveyor", "Noop");
SubscribeToUserPropertyByType("UP2", "Conveyor1", "Conveyor", Noo);
function Noop (sender, property)
{
LogDebug("Noop: " + sender.Name + ": " + sender.GetUserProperty("UP1"))
}
function Noo (sender, property){
LogDebug("Noo: " + sender.Name + ": " + sender.GetUserProperty("UP2"))
}