views:

18

answers:

1

In a projects settings, on the Debug tab, is there a way to use to use the project macro variables in the command line arguments box?

I know you can't use them directly because they don't get expanded but is there a clever solution to this?

EDIT: I'm using a C# project.

A: 

No, this is supported. Silly example I tried: Command Arguments = $(CharacterSet). Got "Unicode" at runtime for argv[1] inside main().

Select "Command Arguments", click on the dropdown arrow, Edit. Click Macros to see what macros are available.

Hans Passant
I should have indicated that I am developing a C# app.
Adam Driscoll
Yes, you should have. The C# IDE doesn't support this. A possible workaround is a post-build event that writes a file that you read in your program. Like `echo $(ProjectName) > "$(TargetDir)cmdargs.txt`
Hans Passant
Sorry for the vague details. Thanks, that's a good idea.
Adam Driscoll