Forum Navigation
You need to log in to create posts and topics.

Beating the TextEdit limit

Posted by: mags <mags@...>

Hello All,

I'm working on a little terminal programme in which I am
trying to confine the length of text in the terminal
window to below the 32K TextEdit limit.

In general it seems to work OK but the updating is
pretty jerky.

Would there be a better way to approach this ?

Oh by the way, it's part of a PG project which is why
I strip out the last char of the string I want to display.
it forces PG to update the scroll bar and button.

LOCAL FN PrintChars

DIM t;8
DIM lastChar$
DIM OsErr%

gTEHndl& = TEHANDLE(_TerminalFld)
osErr% = FN HLOCK(gTEHndl&)
gtxtLgth& = gTEHndl&..TELength%
lastChar$ = RIGHT$(gTheChar$,1)
gTheChar$ = LEFT$(gTheChar$,(LEN(gTheChar$) - 1))
LONG IF gtxtLgth& => 16000
gselStart% = 0
gselStop% = LEN (gTheChar$)
%[gTEHndl&]+_teSelStart, gselStart%
%[gTEHndl&]+_teSelEnd, gselStop%
CALL TEAUTOVIEW(_False,gTEHndl&)
CALL TEDELETE (gTEHndl&)
CALL TEAUTOVIEW(_ztrue,gTEHndl&)
CALL TECALTEXT (gTEHndl&)
t = WINDOW(_MonitorFld) + _portRect
CALL TEUPDATE(t,gTEHndl&)
END IF
gtxtLgth& = gTEHndl&..TELength%
CALL TESETSELECT(gtxtLgth&, gtxtLgth&, gTEHndl&)
CALL TEINSERT (@gTheChar$ + 1, LEN(gTheChar$), gTEHndl&)
osErr% = FN HUNLOCK(gTEHndl&)
TEKEY$ = LastChar$

END FN

Thanks in a advance for any help.

Sean.