Board index » delphi » need some help with TP7.0

need some help with TP7.0

I am following a course Tp 7.0 and i encountered a problem which i can't
solve. With this posting I hope that someone can help me out.

My problem is the following :

When I declare a variable an integer variable and the program is running and
the user doesn't use an integer variable but a string or char variable, the
program is terminated. I am searching for a way to make the program resistend
to this problem. I just don't know how to do so.

If you know an answer to my question, please e-mail me !

With kind regards,

Leander Kuster.

L.T.C.A.W.Kus...@KUB.NL

 

Re:need some help with TP7.0


[Posted and emailed]

On Tue, 27 Feb 1996 14:41:48 GMT, L.T.C.A.W.Kus...@kub.nl (KUSTER

Quote
L.T.C.A.W.) wrote:
>When I declare a variable an integer variable and the program is running and
>the user doesn't use an integer variable but a string or char variable, the
>program is terminated. I am searching for a way to make the program resistend
>to this problem. I just don't know how to do so.

Take the user input as a string variable.  Check the input for legality
and then convert it to an integer.  You'll need to use the Val()
procedure for the conversion.
--
Robert B. Clark <rcl...@iquest.net>
"Be wary of strong spirits.  It can make you shoot at tax collectors...
and miss." --RAH

Other Threads