Solved

over flow

Posted on 1998-10-26
4
160 Views
Last Modified: 2010-04-30
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?
0
Comment
Question by:victorlong
  • 2
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
waty earned 50 total points
ID: 1441599
Always work with variables big enough to receive the biggest possible value. You should use double or currency variables.

0
 

Author Comment

by:victorlong
ID: 1441600
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
 
LVL 14

Expert Comment

by:waty
ID: 1441601
You could limit the entry at 10 characters (for example).

0
 

Author Comment

by:victorlong
ID: 1441602
Is this a good idea:

On error goto......
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question