User forums > Using Code::Blocks

How do I pass a file as a command line argument in Debug?

(1/1)

mfcummings:
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

MortenMacFly:

--- Quote from: mfcummings on February 18, 2010, 05:56:46 pm ---Please advise, Thanks for your input.

--- End quote ---
Did you ensure that you setup the path to execute the application correctly in the project settings for your debug target?

mfcummings:
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

Navigation

[0] Message Index

Go to full version