Results 1 to 15 of 15

Thread: vb6 InkEdit; limit to number of lines/ words/ chars?

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2010
    Posts
    61

    vb6 InkEdit; limit to number of lines/ words/ chars?

    I have a 'word list' of @ 16,000 words (1 per line) that opens in an InkEdit box, but only shows the first 6,766 words (54,015 chars.)

    Is this the limit of what I can load into this at any one time? Googling this gives me no info specific to VB6 so far.

    Thanks

  2. #2
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    The InkEdit is built on top of the RichEdit control, much as the usual RichTextBox is. So in just the same way available addressable memory is the real limit. I don't have problem stuffing in a lot of words:

    Name:  sshot1.png
Views: 728
Size:  17.1 KBName:  sshot2.png
Views: 639
Size:  17.7 KB

    Maybe you didn't actually put as much text in there as you thought?
    Attached Files Attached Files

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2010
    Posts
    61

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    18,480 words according to MS word...

    From the performance of the program, I'm fairly certain that not only did it not load up more than the first 6000 ish words into the InkEdit box, it didnt put them all in the array either; probably the same number of words.

  4. #4

    Thread Starter
    Member
    Join Date
    Jul 2010
    Posts
    61

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    Your InkEdit TOM demo works fine on my VB6; can I attach the code and files, and someone can run it to see if they get the same result? srolling down the InkEdit2 box, last word on list is 'домосе' on mine...

  5. #5
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,909

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    Worked just fine for me. Loaded 30,000 lines, which was what the NUMBER_OF_WORDS constant was set at.

    I changed it to 60,000 words and it still worked fine. Then I tried 200,000 words and it still worked fine. It took 47 seconds to load the 200,000 words.

    Also, I scanned the list, and it's getting deep into the alphabet, lots of Ws and definitely some Ys, so I think it's reading all of the wordlist.txt file.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  6. #6

    Thread Starter
    Member
    Join Date
    Jul 2010
    Posts
    61

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    Yes, Dilettante's code works fine, I've modified it to do what I want, and the limit of @6770 chars disappears. Still don't know why my code does that, but who cares, I'll use my version of Dilettante's instead! If thats ok with Dilettante, of course...

  7. #7
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    If it helps you go for it. Just call me "Old Freebie," fellow Earthicans.

  8. #8

    Thread Starter
    Member
    Join Date
    Jul 2010
    Posts
    61

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    Cheers Freebs!

  9. #9
    Addicted Member jj2007's Avatar
    Join Date
    Dec 2015
    Posts
    206

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    Quote Originally Posted by moorea21 View Post
    Is this the limit
    SendMessage InkEd.hWnd, EM_EXLIMITTEXT, 0, -1 should do the job.

  10. #10
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    Could be a good point, since the Text and TextRTF properties probably do use EM_STREAMIN.

  11. #11
    Addicted Member jj2007's Avatar
    Join Date
    Dec 2015
    Posts
    206

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    It's worth a test, although OP might use plain text (EM_EXLIMITTEXT not applicable), and his 54,015 chars do not correspond with the 'official' 32,767 default limit...

  12. #12
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    MSDN does seem to contradict itself:

    Specifies the maximum amount of text that can be entered. If this parameter is zero, the default maximum is used, which is 64K characters. A COM object counts as a single character.

    ...

    Before EM_EXLIMITTEXT is called, the default limit to the amount of text a user can enter is 32,767 characters.
    Perhaps one of these is in error? If the default really is 64K it would fit the symptoms.

  13. #13
    Addicted Member jj2007's Avatar
    Join Date
    Dec 2015
    Posts
    206

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    Just tested it with an empty RichEd control: 32767 exactly.

  14. #14
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    I'm not sure what you tested, but I don't run into any limit:

    Code:
    Private Sub Form_Load()
        Const CHAR_COUNT As Long = 150000
        Dim S As String
        Dim I As Long
    
        S = Space$(CHAR_COUNT)
        '"Chop it up" into numbered lines:
        For I = 1 To Len(S) - 39 Step 40
            Mid$(S, I, 6) = Format$(CStr(I), "@@@@@@")
            Mid$(S, I + 37, 3) = "|" & vbNewLine
        Next
        'Stick an asterisk at the last character:
        Mid$(S, Len(S), 1) = "*"
        RTB.Text = S
    End Sub
    Name:  sshot.png
Views: 602
Size:  5.5 KB

  15. #15
    Addicted Member jj2007's Avatar
    Join Date
    Dec 2015
    Posts
    206

    Re: vb6 InkEdit; limit to number of lines/ words/ chars?

    Quote Originally Posted by dilettante View Post
    I'm not sure what you tested
    A plain RichEdit control created via CreateWindowEx, no limittext message. Of course, if you let VB or MFC or whatever do the job, you never know what they do under the hood. If you are curious, set a breakpoint, launch the debugger and check for SendMessage...

Tags for this Thread

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