|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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. |
|
#2
|
||||
|
||||
|
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 Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Delphi Programming > Pascal validation problem. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|