hasProperty()

Returns true if the named property exists, otherwise returns false.

Example using hasProperty():

blnResult = nodMyNode.hasProperty(strName)

Parameter

Description

strName

The property name

Use hasProperty() rather than performing a Boolean test on the property name, as this returns false if the property is false or zero.

// this is not safe because if Offset is 0 it will return false
if (node.Offset){
    // do whatever is needed if the node has an Offset property
}

// this is safe
if (node.hasProperty(“Offset”){
    // do whatever is needed if the node has an Offset property
}