As it is, your program cannot correctly read from your data file. And all these if are useless, you can do all of them at once (if cond1 or cond2 or cond 3).

Also, using Borland only functions = bleh