 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
mario_a
Joined: 12 Dec 2004 Posts: 51
|
Posted: Wed May 11, 2005 3:06 pm Post subject: Command-line parameters in expressions |
|
|
The following line produces the output 0, irrespective if any command-line parameters are passed or not :
Should this not display the actual number of parameters passed, since %0% is a variable?
Similarly, this always displays 1, instead of displaying the first command-line parameter (or a blank message box if no parameters are passed) :
When used in their corresponding non-expression forms, they produce the correct output, of course :
| Code: | msgbox, %0%
msgbox, %1% |
Is this a bug or is there something I'm missing about the usage of these special in-built variables in expressions?
Thanks,
Mario |
|
| Back to top |
|
 |
niwi
Joined: 27 Feb 2005 Posts: 128 Location: Heidelberg, Germany
|
Posted: Wed May 11, 2005 4:15 pm Post subject: |
|
|
Hi,
I think, this is made by design:
An expression like
could assign x the summary of a and 2 or and the value of the second command line parameter.
So if you like to use cl parameters in expression you should assign their value a real variable:
| Code: | param2 = %2%
x := a + param2 |
NiWi. |
|
| Back to top |
|
 |
mario_a
Joined: 12 Dec 2004 Posts: 51
|
Posted: Thu May 12, 2005 2:15 pm Post subject: |
|
|
| Aah ok, I see. Thanks. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|