By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,678 Members | 2,377 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,678 IT Pros & Developers. It's quick & easy.

Question about setting Command Line Arguments from Project Properties

P: n/a
I have found many threads with this question asked and ostensibly
answered, but none with an example of how exactly to do it. Help! I
know that in order to set up the values of command line arguments from
within the IDE, I go to Project Properties, Configuration Properties,
and then the text box labeled "Command Line Arguments" under the label
"Start Options." But what exactly do I put into that text box?

What I want to do is set up a custom conditional-compilation variable
that will act as a boolean, suppose I want to call it Test1, then I
want to be able to use this code:

#If test1 then
messagebox.show "yes"
#else
messagebox.show "no"
#End if

.....so in order to define that "variable" or compilation constant I
guess would be the right term, and set its value (let's say I want to
set it True), what do I type into the Command Line Arguments text box?
I've tried these, stabbing from what examples I could find but nothing
happens:

test1
/test1
test1=true
test1=-1

.....but it never seems to evaluate to True in the code statement. Am I
close? (Also, by setting the variable in the IDE this way, it should
take effect when I run my app in the IDE by pressing F5, right?, I
mean, it's not like I have to compile to an .exe and then run that .exe
to get it to take effect?)

Thanks very much.

richforman

Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You are mixing two different concepts. You can not do command line
arguments for compile time conditions. The code is already compiled and the
path of execution is already decided. I think you need to look at
condtional compilation contraints in teh Build section of configuration
properties.

Hope it helps
Chris

<rf******@optonline.net> wrote in message
news:11*********************@c13g2000cwb.googlegro ups.com...
I have found many threads with this question asked and ostensibly
answered, but none with an example of how exactly to do it. Help! I
know that in order to set up the values of command line arguments from
within the IDE, I go to Project Properties, Configuration Properties,
and then the text box labeled "Command Line Arguments" under the label
"Start Options." But what exactly do I put into that text box?

What I want to do is set up a custom conditional-compilation variable
that will act as a boolean, suppose I want to call it Test1, then I
want to be able to use this code:

#If test1 then
messagebox.show "yes"
#else
messagebox.show "no"
#End if

....so in order to define that "variable" or compilation constant I
guess would be the right term, and set its value (let's say I want to
set it True), what do I type into the Command Line Arguments text box?
I've tried these, stabbing from what examples I could find but nothing
happens:

test1
/test1
test1=true
test1=-1

....but it never seems to evaluate to True in the code statement. Am I
close? (Also, by setting the variable in the IDE this way, it should
take effect when I run my app in the IDE by pressing F5, right?, I
mean, it's not like I have to compile to an .exe and then run that .exe
to get it to take effect?)

Thanks very much.

richforman

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.