473,474 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

strange "overload" error at only 32999

88 New Member
hi all,

i am trying to convert the string "32999" to a number, in order to compare it to other numbers and tell which one is the largest one, or if they're equal.

i keep getting an overflow error. this is for a macro organizing numbered folders, so i started out with lower numbers using
Expand|Select|Wrap|Line Numbers
  1. CInt(myNumberString)
which worked fine up to this point.
the odd thing is that i get overload using CLng and CDbl as well, even though i understand the limits for long and double numbers should be much higher. i have debugged and verified that the string being converted is really "32999".

what should i do to solve this?

(i'm writing vba for outlook 2003, running on win2k)
Apr 25 '08 #1
2 1256
BlackMustard
88 New Member
i found the problem myself:

32999 is a number too large to store in an integer variable - but even though i changed the explicit conversion to double, the variable was still declared as an integer. therefore, an implicit conversion to integer took place, which caused the overflow.
Apr 25 '08 #2
jamesd0142
469 Contributor
Try using long im not sure what the max value of this is but its certainly bigger than standard integer.
Apr 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Raghu | last post by:
Hello All, I need some help regarding overloading operation. Is there any way to overload typecasting? I mean if i have a piece of code as below. int a = 2: float b; b = (float)a;
0
by: bjpandapark | last post by:
Hi, I am working on my homework...and I have to do create a class where it can calculate the area of the rectangle while under these conditions.. 1. limit the width and length ...under 20...
5
by: Alan Searle | last post by:
I am exporting ms-access data to XML files. This works fine. However, I need to insert one line at the top of each exported file (i.e. a reference to the XSL file) and am having a problem with...
3
by: 0infinity0 | last post by:
Why wont the operator work #include <iostream.h> class A { public: A * operator = (A * rhs) { cout << "Ptr cpy" << endl; return this;
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
3
by: Kim Stubberup | last post by:
I am making a script parser and I need to interpret the word AND and "replace" it with an &, so that it can be compiled at runtime with the C# compiler. My script would read e.g: if(...
14
by: Jess | last post by:
Hi, I read about operator overloading and have a question regarding "operator->()". If I have two classes like this: struct A{ void f(); }; struct B{
9
by: Anthony Williams | last post by:
Hi, Should the following compile, and what should it print? #include <memory> #include <iostream> void foo(std::auto_ptr<intx) { std::cout<<"copy"<<std::endl;
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.