Cmd line bug

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
coffee
Posts: 56
Joined: 01 Apr 2017, 07:55

Cmd line bug

30 Nov 2017, 06:13

Not sure if it's a matter of no one using command line arguments with autohotkey_h, or that no one uses autohotkey_h v2, or a mixture of both, but, since release 2 a081 H003 (oldest one I have) autohotkey_h has been unable to parse cmd line args properly.
It repeats the arguments. This issue doesn't happen with lexikos' version.

To reproduce

Ahk file


Command prompt

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

autohotkey.exe autohotkey.ahk first second third

Above results in first second third second passed to the script.

Command prompt

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

autohotkey.exe autohotkey.ahk first second third fourth

Above results in first second third fourth second fourth passed to the script.
HotKeyIt
Posts: 1646
Joined: 29 Sep 2013, 18:35
Contact:

Re: Cmd line bug

30 Nov 2017, 14:41

It is not a bug, it is a feature but I forgot to mention it in docs.
If you want to access passed parameters one by one you will need to use:

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

Loop A_Args.length()
MsgBox A_Index "`n" A_Args[A_Index]

Additionally in your example you can access parameters by name:A_Args.first = "second" and A_Args.third = "fourth"
coffee
Posts: 56
Joined: 01 Apr 2017, 07:55

Re: Cmd line bug

30 Nov 2017, 18:49

HotKeyIt wrote:It is not a bug, it is a feature but I forgot to mention it in docs.
If you want to access passed parameters one by one you will need to use:

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

Loop A_Args.length()
MsgBox A_Index "`n" A_Args[A_Index]

Additionally in your example you can access parameters by name:A_Args.first = "second" and A_Args.third = "fourth"

Like a security feature? or what does it provide? can you link a commit?
HotKeyIt
Posts: 1646
Joined: 29 Sep 2013, 18:35
Contact:

Re: Cmd line bug

30 Nov 2017, 20:41

No this is a feature to pass command line parameters by name, see here: https://github.com/HotKeyIt/ahkdll/blob ... t.cpp#L948

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 4 guests