RosettaCodeData/Task/Classes/AutoHotkey/classes.ahk

20 lines
399 B
AutoHotkey
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
obj := new MyClass
obj.WhenCreated()
class MyClass {
; Instance Variable #1
time := A_Hour ":" A_Min ":" A_Sec
; Constructor
__New() {
MsgBox, % "Constructing new object of type: " this.__Class
FormatTime, date, , MM/dd/yyyy
; Instance Variable #2
this.date := date
}
; Method
WhenCreated() {
MsgBox, % "Object created at " this.time " on " this.date
}
}