Computer Science Canada if error occures... |
Author: | greenapplesodaex [ Tue Jun 08, 2004 9:24 pm ] |
Post subject: | if error occures... |
if error occures, such as int out flow or string left bound less than 1, can i somehow, stop the program from shuting down and jsut skip this part by using "return" or "exit"?? can i detect error in turing before it shuts down and do something to it? |
Author: | Tony [ Tue Jun 08, 2004 9:56 pm ] |
Post subject: | |
you'd probably have to error trap that by first checking if the number is small enough to not allow an overflow (such as if you're *=2 then make sure the number is <(maxint/2) check what kind of bounds you're using for your string... Just try to get into a habbit of now allowing such events to occur, and if that is out of your control, then error trap that |
Author: | greenapplesodaex [ Wed Jun 09, 2004 1:30 pm ] |
Post subject: | reply |
awww.. poop |
Author: | aside [ Wed Jun 09, 2004 3:18 pm ] |
Post subject: | |
if you can make something that detects error and stop the program before it crashes, then you are good enough to make a program that doesn't crash. |
Author: | greenapplesodaex [ Wed Jun 09, 2004 5:21 pm ] |
Post subject: | reply |
isnt that what tony just said? ![]() ![]() ![]() |