Solved

over flow

Posted on 1998-10-26
4
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 7 hours left to enroll

628 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