Code: Select all
x := Child()
class Base
{
static someMethod()
{
MsgBox("Hello")
}
}
class Child extends Base
{
__New()
{
this.someMethod() ; Fails. Need to use Base.someMethod()
}
}
Code: Select all
x := Child()
class Base
{
static someMethod()
{
MsgBox("Hello")
}
}
class Child extends Base
{
__New()
{
this.someMethod() ; Fails. Need to use Base.someMethod()
}
}
Code: Select all
x := Child()
class Base
{
static someMethod()
{
MsgBox("Hello")
}
}
class Child extends Base
{
__New()
{
Child.someMethod()
}
}
Code: Select all
x := Child()
x.someMethod()
class Base
{
static someMethod()
{
MsgBox("Hello")
}
}
class Child extends Base
{
__New()
{
MsgBox("Hello from child.")
}
}
Code: Select all
x := Child()
x.someMethod()
class Base
{
someMethod()
{
MsgBox("Hello")
}
}
class Child extends Base
{
__New()
{
MsgBox("Hello from child.")
}
}
Code: Select all
x := cGSheetsAsDatabase()
y := cExcelAsDatabase()
doSomethingWithCellCoords(x) ; Works
doSomethingWithCellCoords(y) ; Fails
doSomethingWithCellCoords(instanceOfDatabase)
{
MsgBox(instanceOfDatabase.GetCellCoords())
}
class cExcel
{
static GetCellCoords()
{
return "Excel hello"
}
}
class cExcelAsDatabase extends cExcel
{
}
class cGSheetsAsDatabase
{
GetCellCoords()
{
return "GSheets hello"
}
}
Code: Select all
class A {
B() => MsgBox(A_ThisFunc)
}
class C extends A {
static Base := this.Prototype
B() {
super.B() ; This calls the version of B defined by A.
MsgBox(A_ThisFunc)
}
}
C.B()
Users browsing this forum: No registered users and 27 guests