February 10th, 2004, 07:28 AM
Pascal validation problem.
Right, slight problem in Pascal that should be easy to sort but I cant see the solution. Im designing a payroll program for a college project and I have a space to enter wages. Now, I only want the user to be able to enter numbers, and all the letters entered to return a user message stating the letter has been entered and to re-enter the value. At the moment, it returns a runtime error.
Has anyone got any ideas how to setup this validation? Thanks it advance.
February 10th, 2004, 12:59 PM
Read in a string instead of a numeric variable. Then iterate through the string and make sure that it only contains digit characters. If the string looks ok, then convert it to integer.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo