String data type storage size too small
Hi,
I am trying to store text from the clipboard into a variable (string/variable). But the size of the textual matter is greater than the storage size of the two data types.I have to ultimately print the textual matter to a text file. So, the code ends up printing only half of the text.
The only other way I know is splitting the text up by lines and storing each line in an array and then printing each of these lines into the file using a loop.
Does anyone else have a better/shorter way of doing this.
Re: String data type storage size too small
It depends on what the end results are. If you just want to print it, why not just paste the clipboard text into a RichTextBox then you can print it or save it to a file from there.
Re: String data type storage size too small
I thought strings could hold 2 gigs of text. Is your text really bigger than that?
It's possible there's a Chr(0) somewhere in it terminating the string prematurely.
Re: String data type storage size too small
Randem,
I had actually contemplated your suggestion, but just wanted to know if I was missing something. I guess I will have to just paste it from the clipboard.
Ellis,
I am using a subset of VB, not the actual thing. In this subset a string can store only upto 32KB.
Re: String data type storage size too small
If you use the RTB you can use the .SaveFile property to save it to a file. You can print it or search it also.
Re: String data type storage size too small
Randem,
I missed the RTB part of your reply. I use a testing tool, so I am can't create RTBs. I will have to try to directly paste into the file.
Re: String data type storage size too small
What, Aren't you using VB6????
Re: String data type storage size too small
No!!
The testing tool uses a subset of VB.
Re: String data type storage size too small
Well, that would be important to know being that you are posting in a VB6 forum it is assumed you are using VB6...
Re: String data type storage size too small
Quote:
Originally Posted by randem
Well, that would be important to know being that you are posting in a VB6 forum it is assumed you are using VB6...
You're right.
Re: String data type storage size too small
Hi,
Does anyone have any other suggestions? I can't seem to crack this. Any help would be appreciated.
Re: String data type storage size too small
Re: String data type storage size too small
Ask a MOD to move your thread to the appropriate forum for better responses.