
-----------------------------------
zylum
Sat Mar 13, 2004 6:06 pm

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...)

-zylum

-----------------------------------
Delos
Sat Mar 13, 2004 6:14 pm


-----------------------------------
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.

-----------------------------------
zylum
Sat Mar 13, 2004 6:17 pm


-----------------------------------
what do you mean trap ctrl-z?

-----------------------------------
Tony
Sat Mar 13, 2004 6:29 pm


-----------------------------------
it appears that Ctrl+Z messes up your case (attempt to read pass EOF)

-----------------------------------
zylum
Sat Mar 13, 2004 6:35 pm


-----------------------------------
hmm... how do i prevent this???

-----------------------------------
Delos
Sat Mar 13, 2004 6:49 pm


-----------------------------------
Oh...boy...

You're talking about uncrashibility, and you've never heard of Ctrl-Z...

Ok...

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.

So...to 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.
