Author Topic: Run parameters  (Read 7047 times)

Offline planodan

  • Single posting newcomer
  • *
  • Posts: 9
Run parameters
« on: June 25, 2015, 06:26:11 pm »
I'm running CB 13.12, and have a console project that will not run because it cannot open a file.  The file is in the Debug directory with the .exe.  If I just run the program from a cmd prompt, it runs fine, i.e. opens the file.  Therefore I assume it is a path'ing problem.  I'm never had a program fail to run using CB before, so I'm stumped as to what to look for.  Where in CB does it get its run path'ing parameters other than perhaps the "Project Properties" and "Build Options".  These seem to deal only with "builds" but I haven't found anything specifically dealing with run parameters, if such exist.  Thanks

ToApolytoXaos

  • Guest
Re: Run parameters
« Reply #1 on: June 25, 2015, 06:31:21 pm »
Go to Project > Set programs' arguments...

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Run parameters
« Reply #2 on: June 25, 2015, 10:52:46 pm »
Or, to set the working dir (base path where your application will search for files if you don't add a full path):
Project -> Properties -> Build Targets -> Execution working dir

greetings

Offline planodan

  • Single posting newcomer
  • *
  • Posts: 9
Re: Run parameters
« Reply #3 on: June 25, 2015, 11:35:51 pm »
Tried setting that to the path & name of the program, but it didn't make any difference.  Set environ vars under project > properties > EnvVars Option tab using a myconfig file.  Nothing works.  This is a really simple program, that uses one small file.  Everything is in the Debug dir, so it should be looking in the "current directory" for everything, and it does when I invoke the program from a cmd prompt.  It would be fine to run it manually, but of course it means the debugger isn't available.

I did set the "working dir" to the full path - still won't run.

I thought maybe the project itself was corrupt, so I build a new one and added the same pgm to it, and it will not run in the new project.  Very similar projects will load and run just fine and the code is same as other pgms that will run just displays different stuff.  Very weird!

Offline planodan

  • Single posting newcomer
  • *
  • Posts: 9
Re: Run parameters
« Reply #4 on: June 26, 2015, 12:07:54 am »
Sorry, setting the "working dir" did cause the pgm to run.  I had missed a letter in one of the path names, so many thanks.

I'm not sure why that makes a different when in past projects it is set to ".", i.e. current dir, but it certainly did in this case.  Still weird - but probably a logical explanation somewhere.  I appreciate the help.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Run parameters
« Reply #5 on: June 26, 2015, 12:17:07 am »
"." is the project directory. The execution path is set to the project directory so that you have to provide your files only in one place (for ex. The project base directory) and not for every target seperatly in their bin folders...

Greetings