Solved

Adding Big Numbers in VB6

Posted on 2014-12-04
4
116 Views
Last Modified: 2014-12-04
I amm getting an overflow on this line of code:

RelayParts(3, i) = sngStartTime + CLng(RelayParts(6, i))    'first skier...time they started

The array is variant because it contains multiple data types.  sngStartTime = 55947 and CLng(RelayParts(6, i)) = 600

What can  I do differently?
0
Comment
Question by:Bob Schneider
4 Comments
 
LVL 58

Assisted Solution

by:Gary
Gary earned 167 total points
ID: 40481861
Declare sngStartTime  as CLng
0
 
LVL 47

Accepted Solution

by:
Martin Liss earned 167 total points
ID: 40481884
Dim x As Long

x = Relayparts(6, i) '600

Relayparts(3, i) = sngStartTime + x   'first skier...time they started

Open in new window

0
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 166 total points
ID: 40481900
You need, at least, to be aware of the limits of the declared data types  in the arithmetic expression. There are also limits to the value of intermediate calculations.

Firstly, what type is the Relay() declaration?
0
 

Author Comment

by:Bob Schneider
ID: 40481948
THat was the mistake.  I accidentally had the array type as integer.  My bad.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add and format columns in vb6 7 71
Spell Check in VB6 13 137
Automatic Email Reminder 4 75
Export PDF Form fields to Access  or Excel  in Tab order 16 113
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

733 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