HasMethod.md

September 23, 2021 ยท View on GitHub

HasMethod(Value, Name) returns whether Value has a method identified by Name. Value must not be a COM object.

If Value is a primitive (Number or String) type, it will examine the default base object.

It can recognize methods identified by objects.

This function is useful for validating interfaces for ad hoc polymorphism.

Examples

Object := {}

F(this)
{
}

HasMethod(Func("HasMethod"), "Call")      ; 1
HasMethod([], "_NewEnum")                 ; 1
HasMethod(0, "Wrong")                     ; 0
HasMethod({(Object): Func("F")}, Object)  ; 1