Object of functions in a librairy

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
LeSeb
Posts: 17
Joined: 25 Oct 2017, 14:50

Object of functions in a librairy

28 Sep 2018, 17:52

Hello people,

In one of my scripts i have many sub used to "move" the cursor to a certain area in an external software.
I named those subs like this :
- goReference
- goThere
- goSecondLine
- etc....

Lately, i decided to convert those sub to functions and to put them all together in a Librairy.
But what i wanted to do first was to create a go array (or object) and add methods to it.

Like so :

Code: Select all

go := object()

go.reference()
{
...things
}
go.there()
{
...things
}
go.secondLine()
{
...some more things
}
Now let's say that i put those functions into my librairy, ..\Lib\daddy.ahk
And let's say that my main script is called ..\main.ahk

How can i put my object of functions into daddy.ahk ?

I tried this with no success :

Code: Select all

go := object()

daddy_go.reference()
{
...things
}
daddy_go.there()
{
...things
}
daddy_go.secondLine()
{
...some more things
}
Any idea ?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Draken, haomingchen1998, mikeyww, ReyAHK and 263 guests