473,626 Members | 3,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2058
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******@opton line.net> wrote in message
news:11******** *************@c 13g2000cwb.goog legroups.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
2601
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 prompt but how can i achieve it in an application in VS.NET? Thank you
1
3663
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 with other languages, there don't seem to be any specific C++ options for command line arguments. Aleks
5
11561
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 options are incompatible". But when I view the .vcproj file, I cannot find the '/RTC1' option Thanks Yifan
1
7893
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. I have to do it this way as the consumer of the service should not be able to change the argument - except by uninstalling and reinstalling the service. I created the service and the service itself works great. However, when I try to install...
1
250
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 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...
1
254
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 I get at from my addin? I've tried looping through pplicationObject.Solution.Projects.Item.Properties collection but it's not there. Regards
4
1978
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 -> Project Properties -> Configuration Properties -> Debugging -> Command Arguments. The blurb provided in the properties window for this field reads "The command line arguments to pass to the application." which sounded promising.
2
1380
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? Thanks.
7
9354
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 display the Windows form. The form is being displayed but the command only returns when the form is closed. I want the command line to return immediately, leaving the form displayed.
0
8202
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8641
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8366
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8510
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2628
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.