Click to See Complete Forum and Search --> : How much can a string variable hold
badgers
Nov 19th, 1999, 01:59 AM
I found my problem. I am assigning text to a string variable. It seems that the string is not able to hold all the text. Is there a larger variable that can hold text the way I want?
code except:
Dim temp As String
Dim section(150) As String
Dim i, j, newfile As Integer
newfile = FreeFile
Open "c:\temp\999edcs.txt" For Input As newfile
While Not EOF(newfile)
Line Input #newfile, temp
If InStr(temp, ">") And InStr(temp, "<") Then
List1.AddItem (section(i))
i = i + 1
Else:
section(i) = section(i) & temp & vbCrLf
End If
Wend
For i = 0 To List1.ListCount - 1
List1.Selected(i) = True
Next i
Close newfile
Text1.Text = "edcs9999.txt"
------------------
I am so skeptacle, I can hardly believe it!
Aaron Young
Nov 19th, 1999, 02:56 AM
A variable Length String can hold Approx' 2 billion Bytes, so I doubt that's your problem.
Are you getting an Error?
What are you trying to do?
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net
badgers
Nov 19th, 1999, 03:09 AM
I dont get an error. Does it matter that the variable is a string array?
my post contains what I am doing with the string variable. Do you think that the problem is when I assign the text to the list box? thank you for your time and have a good day
Aaron Young
Nov 19th, 1999, 03:18 AM
I've run your code with the Textfile you supplied and it works fine, it doesn't lose any data anywhere.
I think you're misinterpeting the Width of the Listbox as the end of the Sections Text.
Just because you can't see the full string in the Listbox, doesn't mean it's not there.
In your Loop, get Debug to Print Each Section No. and the Contents to check for yourself.
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net
badgers
Nov 19th, 1999, 03:23 AM
I am an idiot! it was not the string but when I assign it to the list box. The listbox is responsible for trimming the text.
thank you for your time and have a good day
------------------
I am so skeptacle, I can hardly believe it!
badgers
Nov 19th, 1999, 03:35 AM
Can the admin please delete this post I wish that I never started this thread
thank you
Juan Carlos Rey
Nov 19th, 1999, 08:28 AM
1- Please don't feel shammy, (is it spelled that way?)- we all learn from every post
2- You can delete your post yourself, just click on "edit/delete" (that icon with a little pencil)
[This message has been edited by Juan Carlos Rey (edited 11-19-1999).]
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.