下面是在VBA里的代码:
» 下面是: 可获取参数的脚本.ahk
; process command line parameters -- DEBUG: optional (see above)
getParams:
If 0 > 0
{
Loop, %0% ; for each parameter
{
param := %A_Index%
MsgBox %param%
; check for switches
StringLeft, paramType, param, 1
If paramType = - ; switch indicator
{
; determine type of switch
StringMid, switch, param, 2, 1
; switch
If switch = x ; DEBUG: template (replace "x")
{
; access value (= next parameter)
param = % A_Index + 1
var_x := %param% ; DEBUG: template (replace "var_x")
}
}
}
}
Return