[futurebasic] Beating the TextEdit limit

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: mags craven <mags@...>
Date: Tue, 16 Dec 1997 11:44:35 +0000
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&)
      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$


Thanks in a advance for any help.