At first I spent lots of time trying to figure out why it doesn't show the parameters for a function. (A script has parameters. A function has parameters. A_args are the parameters. hmmm.... I think a doc note is in order about what for many may be a misunderstanding of A_args.)
Anyway, I can't figure this out this script. Why does the MSGBOX display show null values for A_args[1], A_args[2] etc.?
Test.ahk:
Code: Select all
st := "now is the time for all good men ..."
msgbox % subword(st,3,2)
exitapp
Code: Select all
SubWord(Phrase,Num,Length=1,Delimiter=" ") {
global
msgbox % a_args[1] a_args[2] a_args[3]
for n, param in A_Args ; For each parameter:
{
MsgBox Parameter number %n% is %param%.
}
}
One confusing thing is: when I open TEST.ahk and look at the variables, A_args is shown.
It looks like the global statement doesn't access A_args.
Please don't tell me A_args is not a variable. If you do, then: why is it listed as a variable when I open TEST.ahk and view it's variable?