Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: mfcummings on February 18, 2010, 05:56:46 pm

Title: How do I pass a file as a command line argument in Debug?
Post by: mfcummings on February 18, 2010, 05:56:46 pm
Hello,

I want to debug a program that I'm having problems with.  Rather than restructure the whole program to bypass the initial specifications, I was hoping to discover a way to pass a file as an argument in debug mode.  I have a simple console project that parses a text file, I tried Project-> "Set Programs Arguments..." and included the name of the text file with all of the possible variations (highlighting "Debug" & "Release", check/uncheck "This target provides..", putting the file name in quotes, etc.) to no avail.

I'm using Code::Blocks v. 8.02 on Win7 using a simple notepad .txt file as an input parameter.

Please advise, Thanks for your input.

MFC
Title: Re: How do I pass a file as a command line argument in Debug?
Post by: MortenMacFly on February 18, 2010, 06:10:14 pm
Please advise, Thanks for your input.
Did you ensure that you setup the path to execute the application correctly in the project settings for your debug target?
Title: Re: How do I pass a file as a command line argument in Debug?
Post by: mfcummings on February 18, 2010, 08:09:32 pm
I did not, but with your suggestion I added the complete path.  When that didn't work, I wrapped the full path in quotations and that did work!

Thank you for your suggestion, you solved my problem and now I can concentrate on more productive troubleshooting.   :D