over flow

Hi experts

I am making a program which needs to calculate some numbers.

When the user input some very big numbers, the calculation may cause OVER FLOW and the program stopped!

How can I detect the calculating result will be over flow and avoid the program stopping?
victorlongAsked:
Who is Participating?
 
watyCommented:
Always work with variables big enough to receive the biggest possible value. You should use double or currency variables.

0
 
victorlongAuthor Commented:
Hi Waty

In my program, no matter what variables type I use, a user can always causes a over flow result. That is because the user doing something wrong and the program may not stop the user doing so.


0
 
watyCommented:
You could limit the entry at 10 characters (for example).

0
 
victorlongAuthor Commented:
Is this a good idea:

On error goto......
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.