|
-
Apr 16th, 2000, 06:07 PM
#1
Thread Starter
Registered User
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?
-
Apr 16th, 2000, 06:42 PM
#2
Hyperactive Member
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....)
-
Apr 16th, 2000, 07:07 PM
#3
Fanatic Member
I tried it, too, on my computer (433 mHZ, 196MB of RAM) and it worked fine.
-
Apr 16th, 2000, 07:14 PM
#4
Fanatic Member
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)
Iain, thats with an i by the way!
-
Apr 16th, 2000, 10:41 PM
#5
Thread Starter
Registered User
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?
-
Apr 17th, 2000, 12:29 AM
#6
transcendental analytic
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.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 17th, 2000, 01:58 AM
#7
Addicted Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|