I am trying to create a program that grabs 3 users' names and finishing times, compares the numbers, and then displays the names of who finished a race the fastest. For reference, I am trying to solve Programming Challenge #4 on page 279 of the book Visual Basic 2012 Sixth Edition. I already have the following code. I have tested it, and it works. However, I need to figure out how to include a way to check errors against the following: "No runner name can be blank, and finishing times must be both numeric and positive."
http://pastebin.com/M8TVvMug
Any help would be greatly appreciated. If you need anymore information, just ask.
Thanks for the quick responses. I'll give those suggestions a try.
[Edit]
splodgemolly, your suggestion worked; however, I'm still not understanding where or how to insert anarekist's suggestion. If one of you guys could elaborate on that part, it would be much appreciated. In the meantime, I'll see if I can figure it out on my own.
I'm still having trouble with negative numbers. I tried using your suggestion, anarekist, but the program still allows negative numbers to be calculated. Here's the updated code...
http://pastebin.com/HuMh0kxr
Where and how would I insert your suggestions above? I likely did it incorrectly, but I tried using the less than zero check and it still didn't work. I did get the "No runner name can be blank" part taken care of, but the "finishing times must be positive" part is still giving me problems.
Thanks for all the help guys. I finally got it to work. The Sgn function goes by "Math.Sign()" in Visual Studio Express 2012. That's why I couldn't get it work.
Once again, thanks for your time! I really appreciate it.