Solved

Adding Big Numbers in VB6

Posted on 2014-12-04
4
111 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 46

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

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 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…
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…

773 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