Results 1 to 13 of 13

Thread: String data type storage size too small

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    30

    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.

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    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.

  3. #3
    PowerPoster Ellis Dee's Avatar
    Join Date
    Mar 2007
    Location
    New England
    Posts
    3,530

    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.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    30

    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.

  5. #5
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    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.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    30

    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.

  7. #7
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: String data type storage size too small

    What, Aren't you using VB6????

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    30

    Re: String data type storage size too small

    No!!
    The testing tool uses a subset of VB.

  9. #9
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    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...

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    30

    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.

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    30

    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.

  12. #12
    Frenzied Member
    Join Date
    Sep 2006
    Location
    Scotland
    Posts
    1,054

    Re: String data type storage size too small

    Use an array.

  13. #13
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: String data type storage size too small

    Ask a MOD to move your thread to the appropriate forum for better responses.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width