|
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |
1. Limitation on number of characters in multi-row entry control ??? #13212 Posted by: Michael S 2010-02-17 19:41:25 Last edited by: Michael S 2010-02-17 19:43:10 (Total edited 2 times) |
Ran into the following limitation/bug for an entry control. Using the following code
guiaddctltext('sql_results', str)
guisendmsg("sql_results", "SETSEL", 0, 0)
guisendmsg("sql_results", "SCROLLCARET")
(where str contains "lines" delimited by "0D0A"x) and where sql_results is defined as
entry 9, 73, 351, 206, multi|readonly|border|vscroll|tabstop, clientedge, sql_results
I notice that the results are getting "chopped" after approx 30000 characters (I had/needed to write 32965)
Is this a bug/deliberate limitation ? |
2. #13213 |
Is this on Windows 95/98/ME? Those have that size limitation. Win 3000/XP/Vista don't. |
3. This is on Windows XP #13214 |
Do you want me to throw together a quick test example ? |
4. #13215 Posted by: PeterJ 2010-02-18 16:17:34 |
Yes, please. I tried to create an example out of your descriptions, with little success. |
5. Here's an example #13216 Posted by: Michael S 2010-02-18 17:48:49 Last edited by: Michael S 2010-02-18 17:49:32 (Total edited 1 time) |
LIBRARY rexxgui
guierr = "SYNTAX"
guiheading = 1
guicreatewindow('NORMAL')
limit = 367
temp = ""
DO i = 1 TO limit
temp = temp || LEFT("This is line "i,80) || "0D0A"x
END
y = RIGHT(temp,90)
y = TRANSLATE(y, "<>", "0D0A"x)
SAY "Total characters = "LENGTH(temp)", last 90 characters ***"y"****"
guiaddctltext('sql_results', temp)
guisendmsg("sql_results", "SETSEL", 0, 0)
guisendmsg("sql_results", "SCROLLCARET")
again:
DO FOREVER
guigetmsg()
IF EXISTS('GuiObject') == 0 THEN DO
IF EXISTS('GuiSignal') THEN DO
END
END
ELSE DO
IF EXISTS('GuiSignal') == 0 THEN DROP (guiobject)
ELSE SELECT guiobject
WHEN 0 THEN NOP
OTHERWISE
END
END
CATCH SYNTAX
CONDITION()
SIGNAL again
CATCH HALT
FINALLY
guidestroywindow()
END
RETURN
|
6. #13217 Posted by: PeterJ 2010-02-18 18:55:07 |
yes, it cuts off after 30000 bytes. I slightly modified the do loop:
line=COPIES('1234567890',8)
DO i = 1 TO limit
temp = temp || OVERLAY("This is line "i">>",line)|| "0D0A"x
END
and received the following output (last lines)
this is line 364>>90123456789012345678901234567890123456789012345678901234567890
this is line 365>>90123456789012345678901234567890123456789012345678901234567890
this is line 366>>9012345678901234567890123456789012345678901234567890
which means we have 365 lines with 80 chars + CRLF= 365*82=29930 bytes + 70 bytes for line 366 = 30000 bytes. |
7. #13218 Posted by: Jeff Glatt 2010-02-19 14:01:05 Last edited by: Jeff Glatt 2010-02-19 14:02:32 (Total edited 1 time) |
After you create the window (containing the multiline entry control), try sending the entry control a "LIMITTEXT" message, passing the maximum number of characters you want it to hold:guisendmsg("MyMulti", "LIMITTEXT", 400000)
|
8. Wow - that was easy to fix. #13219 |
Thanks Jeff. Since I know the size of the variable I want to write to the ML entry, I assume there's no problem in including this code
guisendmsg("sql_results", "LIMITTEXT", 100+length(sql_results))
before each guiaddctltxt ?? |
9. #13220 Posted by: PeterJ 2010-02-19 15:47:45 |
adding it before GUIADDCTLTEXT works fine!
guisendmsg("sql_results", "LIMITTEXT", 100+length(temp))
guiaddctltext('sql_results', temp)
...
|
10. #13221 |
OK, but you need to do it only once after the control is created. You don't have to do it every time you change text. |
11. Granted, your example of 400,000 is MASSIVE, #13222 |
but both Peter and I have probably reasoned that by setting it to the actual number of bytes each time, the code will never fail.
One thing I've noticed with my Reginald exe code is that it's fast, so I never bother/worry about "unnecessary" code - it simply doesn't seem to make any difference to elapsed time. |
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |