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
3 Attachment(s)
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:
Maybe you didn't actually put as much text in there as you thought?
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.
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...
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.
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...
Re: vb6 InkEdit; limit to number of lines/ words/ chars?
If it helps you go for it. Just call me "Old Freebie," fellow Earthicans.
Re: vb6 InkEdit; limit to number of lines/ words/ chars?
Re: vb6 InkEdit; limit to number of lines/ words/ chars?
Quote:
Originally Posted by
moorea21
Is this the limit
SendMessage InkEd.hWnd, EM_EXLIMITTEXT, 0, -1 should do the job.
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.
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...
Re: vb6 InkEdit; limit to number of lines/ words/ chars?
MSDN does seem to contradict itself:
Quote:
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.
Re: vb6 InkEdit; limit to number of lines/ words/ chars?
Just tested it with an empty RichEd control: 32767 exactly.
1 Attachment(s)
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
Attachment 133527
Re: vb6 InkEdit; limit to number of lines/ words/ chars?
Quote:
Originally Posted by
dilettante
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...