file existance getting screwy on me...
This is a hashed down version, but shows what I'm doing syntax wise:
Code:
repeatmenu:
// code to display options
// switch stuff
case '1':
if ((system("Pgm.exe >NUL") == 0))
{
printf("There was an error!?!?!?\nblabla....");
getch();
}
else
{
// Program executed fine.
// do any records / log file work here, or nothing at all
}
goto repeatmenu;
break;
Obviously I have the default, and escape cases, I just wanted to concentrate on the if statement. I want to check for errors upone execution of "this program". If it does produce an error I want to surpress it. I want to supress any output at all from the dos program. (since I'm familar with the pgm) Under the possible circumstances I know what errors will occur how, so I can trap them, surpress them, then display my own.
Yes, I know.........WHY?!?!?!?!?
Just cause.
Anyhow,
Under that conditions i'm running the program, it's acting up on me. It executes the program fine ( displaying no error messages ), then when your done with the program and it bombs you back to dos.......it displays the error message...why? I've done this before and am familar with it, I must be missing something...