AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Command-line parameters in expressions

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
mario_a



Joined: 12 Dec 2004
Posts: 51

PostPosted: Wed May 11, 2005 3:06 pm    Post subject: Command-line parameters in expressions Reply with quote

The following line produces the output 0, irrespective if any command-line parameters are passed or not :

Code:
msgbox, % 0


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) :

Code:
msgbox, % 1


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
View user's profile Send private message
niwi



Joined: 27 Feb 2005
Posts: 128
Location: Heidelberg, Germany

PostPosted: Wed May 11, 2005 4:15 pm    Post subject: Reply with quote

Hi,

I think, this is made by design:
An expression like
Code:
x := a + 2

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
View user's profile Send private message
mario_a



Joined: 12 Dec 2004
Posts: 51

PostPosted: Thu May 12, 2005 2:15 pm    Post subject: Reply with quote

Aah ok, I see. Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group