Computer Science Canada

database program

Author:  zylum [ Sat Mar 13, 2004 6:06 pm ]
Post subject:  database program

this is a program i had to make for my compsci class... it's supposed to by completely bulletproof (can never crash) well here it is... can you guys test it and try to find any way to make it have an error??? (besides integer overflow...)


Author:  Delos [ Sat Mar 13, 2004 6:14 pm ]
Post subject: 

Dude...2 things

1) with that much code (200+ lines), attatch a file...
2) you didn't even trap Ctrl+Z!

Well, seeing as you asked for bugs, there you are.

Author:  zylum [ Sat Mar 13, 2004 6:17 pm ]
Post subject: 

what do you mean trap ctrl-z?

Author:  Tony [ Sat Mar 13, 2004 6:29 pm ]
Post subject: 

it appears that Ctrl+Z messes up your case (attempt to read pass EOF)

Author:  zylum [ Sat Mar 13, 2004 6:35 pm ]
Post subject: 

hmm... how do i prevent this???

Author:  Delos [ Sat Mar 13, 2004 6:49 pm ]
Post subject: 


You're talking about uncrashibility, and you've never heard of Ctrl-Z...


Back in ClassicTuring, there existed 2 keys: Ctrl+C, and Ctrl+Z.
Ctrl+C was the auto-breaker, that paused a proggie...even in exe format.
Ctrl+Z was the eof denoter, which would crash most every prog, except the really well written ones, but even in those it would cause it to end.
Those were the most difficult keys to trap.

Fast forward to WinOOT.
Introduce the getch command. Back in Classic, the getch command would die w/ Ctrl+Z. But, in WinOOT, where the whole DOS-like idea of eoffing out of a prog is far less common, getch handles Ctrl+Z as Ctrl+Z, not eof.
get still dies with it though. answer your question.
Set up a getch-based input, from which you can pass results to a verifying procedure (that can check for strintoks etc), which then passes a result back to the programme to be carried forth.

Nothing beyond your capabilities, I'd say.