Code: Select all
BaseType(this){
if ComObjType(this)
return "ComObj"
Loop {
class:=this.__Class
,this:= this.base
} Until (InStr(".Object.Number.String.", "." this.__Class "."))
return class
}
Code: Select all
BaseType(this){
if ComObjType(this)
return "ComObj"
Loop {
class:=this.__Class
,this:= this.base
} Until (InStr(".Object.Number.String.", "." this.__Class "."))
return class
}
However, this.base can return something that is not an Object if the base property was overridden, or (in more general cases) if this is a COM object.BaseObj must be an Object.
If assigning the new base would change the native type of the object, an exception is thrown. An object's native type is decided by the nearest prototype object belonging to a built-in class, such as Object.Prototype or Array.Prototype. For example, an instance of Array must always derive from Array.Prototype, either directly or indirectly.
Source: Object - Methods & Properties | AutoHotkey v2
Return to “Scripts and Functions (v2)”
Users browsing this forum: No registered users and 52 guests