HasProp

Returns a non-zero number if the specified value has a property by the specified name.

HasProp := HasProp(Value, Name)

Parameters

Value

Type: Any

Any value, of any type except ComObject.

Name

Type: String

The property name to check for.

Return Value

Type: Integer (boolean)

This function returns true if the value has a property by this name, otherwise false.

Remarks

This function does not test for the presence of a __Get or __Set meta-function. If present, there is no way to detect the exact set of properties that it may implement.

This function supports primitive values.

Objects, HasBase, HasMethod

Examples

Illustrates the use of this function.

MsgBox HasProp({}, "x") ; 0
MsgBox HasProp({x:1}, "x") ; 1
MsgBox HasProp(0, "Base") ; 1