Question about Class variables

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Klark92
Posts: 149
Joined: 18 Jan 2015, 19:33

Question about Class variables

12 Aug 2018, 05:52

Code: [Select all] [Download] GeSHi © Codebox Plus

WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
WebRequest.Open("GET", "http://www.google.com/", True)
WebRequest.SetRequestHeader("Accept", "text/html, application/xhtml+xml, */*")
WebRequest.SetRequestHeader("User-Agent", "Android")
WebRequest.Option(6) := False
WebRequest.Send()
WebRequest.WaitForResponse()
msgbox % WebRequest.ResponseText


What is the meaning of Option(6) ? Is that a variable and how can I declare it like that in a class ? thanks

Code: [Select all] [Download] GeSHi © Codebox Plus

Option(index)
{
set
{
if (index = 6)
this.Option(index) := value
}
}
Smart Kombo 1.0 | One of the best Knight Online's key combo program...
Helgef
Posts: 3097
Joined: 17 Jul 2016, 01:02
Contact:

Re: Question about Class variables

12 Aug 2018, 06:36

See object properties and syntax remarks. Example,

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Also note the difference in which meta-functions will be invoked (when using an object derived from the class) for the two syntaxes: () vs[], the latter is probably better for custom classes. That is, do c.option[6] := false, c.option[6] instead.

Cheers.
User avatar
Klark92
Posts: 149
Joined: 18 Jan 2015, 19:33

Re: Question about Class variables

12 Aug 2018, 08:37

thank you. that solved my problem. :beard:
Smart Kombo 1.0 | One of the best Knight Online's key combo program...

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot] and 33 guests