Code: Select all
trouble := "jacks and candy don't mix."
obj := {"water":"H₂O", "❤":"❀ヅ♫"}
trouble.base.storedData := obj
class Text {
characters(data) {
RegExReplace(data, "s).", "", i)
return i
}
}
for reference, function in Text {
if IsFunc(function)
trouble.base[reference] := ObjBindMethod(Text, reference)
}
; TESTING
MsgBox % trouble.storedData.water "`t" trouble.storedData.❤
MsgBox % "Number of Characters in [" trouble "] is " trouble.characters()
; CASE A - Retrieving the String Buffer
MsgBox % address := &trouble ; OK
MsgBox % StrGet(address) ; OK
; CASE B - Getting some reference to the object...
MsgBox % address := Object(trouble) ; NOT WORKING
; CASE C = Using new base functions
extractedBase1 := trouble.base
MsgBox % extractedBase1.storedData.water ; OK
MsgBox % Object(extractedBase1) ; OK
extractedBase2 := ObjGetBase(trouble) ; PARAMETER #1 INVALID
return
https://autohotkey.com/docs/Objects.htm ... n_Pointers
https://autohotkey.com/docs/objects/Object.htm#GetBase