473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Question about setting Command Line Arguments from Project Properties

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
1 2042
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hari | last post by:
can i have command line arguments in VS.NET applicatio? if yes how? Can i have some code snippets of the above functionality? I know we can acjieve this in console application form command...
1
by: Aleks Dubinskiy | last post by:
Does anybody know how to set up command line arguments from C++.NET without going to a DOS shell? In VC++ 6.0 there was an easy way to do it in Options, but now that the environment is integrated...
5
by: Yifan | last post by:
Hi Could any one tell me what project property controls the setting of '/RTC1' option? Now I have a project which has this build error "Command line error D2016 : '/RTC1' and '/clr' command-line...
1
by: amirmira | last post by:
I would like to set command line arguments to a service at install time. I need to do this because I need to get information from different registry locations depending on my command line argument....
1
by: rforman1 | last post by:
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...
1
by: Frank Rizzo | last post by:
I am writing a little add-in that needs to read the Command Line Arguments for the project as defined in the Project Properties\Configuration Properties\Debugging\Command Line Arguments. How do...
4
by: Roland | last post by:
Hi, I am developing a C++ project and want to pass some command line arguments in VS .NET 2003. I am in debug mode, the configuration is set to Debug and I entered my argument list in Project ->...
2
by: John | last post by:
I use VB .NET 2003 and work on a WinForm based app. This app takes some parameters from command line when starting. What project properties can I set so I can see those parameters in debug mode? ...
7
by: Jwe | last post by:
Hi, I've written a program which has both a command line interface and Windows form interface, however it isn't quite working correctly. When run from command line with no arguments it should...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.