I might as well use the code snippet from before ( lol )....
There aren't any return 0's or break's in there to focus on something...Code:/* Run 1941, write to log */ FILE *Exist; if ( ( Exist = fopen("arcade.exe", "r+") ) == NULL ) { printf("\nThere was an error loading 1941.\n"); printf("\nArcade.exe was not found."); printf("\nYou need arcade.exe to load 1941."); getch(); } else { fclose(Exist); if ( ( Exist = fopen("1941.zip", "r+") ) == NULL ) { printf("\nThere was an error loading 1941.\n"); printf("\n1941 was not found."); getch(); } else { fclose(Exist); fprintf(File, "1941\n"); printf("\nLoading 1941..."); system("arcade 1941 >NUL"); } }
The last lines of "code"...
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 ).Code:printf("\nLoading 1941..."); system("arcade 1941 >NUL");
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?
example:
Code:printf("\nLoading 1941..."); system("arcade 1941 >NUL"); if(system("arcade 1941 >NUL") == 0) { printf("\nAn error occured while proccessing 1941.zip"); printf("\nThis is because the zip file is not vaild and missing files,"); printf("\nor the zip file is damaged"); }



LinkBack URL
About LinkBacks



