-
Hey...
When I saw the help for the String Data Type, I saw it can contain up to approximately 2 billion characters.
In fact, it should contain up to 2^31 characters, and this is exactly 2,147,483,648
But when I try to put in the string only 2 million characters, I get an error: "Out Of String Space"
Why?!
I use this simple code:
Code:
Dim X,A as String
A=Space(10000000)
X=A+A
In the 3rd line I get the Error.
Why?!
Any Ideas?
-
Has probably to do with your computer, on my NT Server with 128Mb RAM, I could run your code (although the machine became *very* slow, I didn't get an error....)
-
I tried it, too, on my computer (433 mHZ, 196MB of RAM) and it worked fine.
-
your problem lies with your maths.
Dim X,A as String
A=Space(10000000)
X=A+A
A+A will in fact = 20,000,000 (20 million) not 2,000,000 (2 million)
-
Guys,
I run this code on my Celeron 500, 64MB RAM.
And btw, I know it should be 20 million and not 2 million,
but string can contain up to 2 Billion!!! (2000 million!)
why the string cant handle only 20 million?!?!
Did Microsoft's VB Team Lie ?!
Any Ideas?
-
You need 2G of RAM, then or wait that terrible time while windows is swapping these 2G to your harddisk, i have on a mistake made a 400M string and it took me 15 min to wait.
-
your problem is in your hardware..
you should atleast have 128 mb. ram for this action.
I got 112 mb. and it didn't work wery well.
but when I tried it at my other comp with 128 mb. it worked.
-Lumin