User Properties
-
- Posts: 71
- Joined: Mon Aug 01, 2016 9:45 pm
User Properties
How does one set user properties in a node?
-
- Site Admin
- Posts: 1419
- Joined: Mon Nov 26, 2007 5:51 pm
Re: User Properties
Code: Select all
DSL_node *node = net.GetNode(nodeHandle);
DSL_userProperties &props = node->Info().UserProperties();
// add new property
props.AddProperty("MyPropName", "abc");
// change existing property
int propIndex = props.FindProperty("MyPropName");
if (propIndex >= 0)
{
props.ChangePropertyValue(propIndex, "Modified property value");
}
else
{
// not found
}
-
- Posts: 71
- Joined: Mon Aug 01, 2016 9:45 pm
Re: User Properties
Thanks!!
(Could I have figured this out by searching the ".h" files?)
(Could I have figured this out by searching the ".h" files?)
-
- Site Admin
- Posts: 1419
- Joined: Mon Nov 26, 2007 5:51 pm
Re: User Properties
Probably, as long as you know the DSL_userProperties is the name of the class storing these properties.Could I have figured this out by searching the ".h" files?