Solved

over flow

Posted on 1998-10-26
4
157 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now