There aren't any return 0's or break's in there to focus on something...

The last lines of "code"...

Code:

printf("\nLoading 1941...");
system("arcade 1941 >NUL");

Arcade.exe is a comman line, console program. 1941.zip is going to be opened through arcade.exe. I passed null to the 2nd line there, just so arcade.exe doesn't output it's loading messages, and displays the more user friendly message ( it displays all the files its opening out of 1941.zip....which are odd file names ).

There could be a case ( actually very likely ), that arcade.exe might run into a problem loading a zip archive. This would be because the zip archive is missing files that arcade.exe was pre-programmed to look for.

If it runs into that kind of a problem it will idle endlessly at the "Loading 1941..." prompt doing nothing ( the error message is surpressed ).

Im surpressing the loading messages, because I want the more user friendly ones instead. If it does run into an error, is there a way to catch that and do something with it?

I'm not sure if this is what you're looking for, but...
If If this arcade.exe program actually returns error values, then system("arcade...") should return whatever the status of arcade is upon exiting the program. (I know this is true for UNIX...)

Of course, this assumes that arcade.exe actually uses special exit values to signify errors, which it should. Something like

Code:

i = system("arcade 1941 >NUL");
printf("\nReturn value %d\n",i);

Run under conditions where it will commit the error you are expecting should let you reverse engineer the codes.

10-04-2001

Shadow

ROFL

Man I been watchin the nooooob's to much ( I am one, but still )..
What I asked before? That little example code I gave, I tried it and it worked.

*note to self*: Try any idea's you can come up with before posting...

Welp, the program I been workin on for a week or two will be completed efficiently. I know enough to do everyting it was planned to do.

That's still a little basic, but gives the basic idea. Imagine all that code ( with a few extra lines added in later ) as 1 single case in a siwtch statement. Now, imagine doing that 100 times.

*jots down notes...*
goto statements, "can" be useful for repeating things endlessly till forced to stop.
You can display an error message when checking for a file no matter how many times you stretch, poke, or stab at it.

10-04-2001

Shadow

To QuestionC

Arcade.exe was not coded by me, but a team of over 100 programers ( one of them being professional ). Arcade.exe is just my custom build. Arcade.exe ( or the original program of a different name ), is very very professional, so much infact that it emulates arcade machines ( around 3,000 i believe ). If it fails in loading a file it displays exact which files it did not find, and are required. I dont want to see a mile long list of obscure and crazy file names if it fails in loading, after all i'll know why. Instead one simple message is fine ( File is corrupt ...or smiilar ).

I did run it under error causing conditions ( a zip that was empty but had the same name of a valid archive to load ). They way I have it running now is fine. Arcade.exe does return error values, I just dont want to see them :p