Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 806 Bytes

HasMethod.md

File metadata and controls

21 lines (15 loc) · 806 Bytes

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