|
|
Subject:
VB Run-time error 6 Overflow
Category: Computers > Programming Asked by: xymox-ga List Price: $10.00 |
Posted:
19 Jun 2002 21:01 PDT
Expires: 26 Jun 2002 21:01 PDT Question ID: 29552 |
I'm parsing large amounts of text in VB and get this error: "VB Run-time error 6 Overflow" I'm using the Len function to count the charter length and that is where the error is raised. Example: x = Len(Text) My question is how can I prevent this overflow error? Is there another way to get string length say via an API call? Is Len running out of memory and is there a way to increase it? | |
| |
| |
| |
|
|
There is no answer at this time. |
|
Subject:
Re: VB Run-time error 6 Overflow
From: blcman-ga on 19 Jun 2002 22:56 PDT |
You must declare "x" as a long data type. For example: Dim x as integer x = len(longstring) 'Longstring is a string over 32,768 characters in length Would cause an overflow error Dim x as long x = len(longstring) 'Longstring is a string over 32,768 characters in length Would work The integer data type only allows values from -32,768 to 32,768. More or less than that and you get an overflow error. |
Subject:
Re: VB Run-time error 6 Overflow
From: gking-ga on 20 Jun 2002 01:30 PDT |
how are getting the string for which u want find the length, is it coming from a database or from a file... |
Subject:
Re: VB Run-time error 6 Overflow
From: mangeshp16-ga on 20 Jun 2002 13:28 PDT |
How about breaking the entire string in chunks of equal size and getting length of each chunk. add all these lengths to get length of entire string. eg. vStr="long string" if len(vStr) > 32000 then break the string in chunks end if for i=0 to ubound(chunk) vLen=vLen & len(chunk(i)) next |
Subject:
Re: VB Run-time error 6 Overflow
From: bineshjm-ga on 21 Jun 2002 04:54 PDT |
This problem not VB Your window's files some corrupted. You should reinstall and run your program. I excpet surlty work your program |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |