Re: EM_SCROLLCARET problem

From: Henry Bartlett (hambar_at_Spamlock.microtech.com.au)
Date: 05/06/04


Date: Thu, 6 May 2004 13:13:27 +1000

Gery <gprdataNO@SPAMMMMMzip.com.au> wrote in message
news:1mj9809su6hh9221fgt0h66vmthoi1f8fv@4ax.com...

> I'm using RichEdit to display Div. length Text files.

"Div. length Div. length Text files"?

> As I want always to see the end of the files
> I,m using
> RE.Perform(EM_SCROLLCARET, 0, 0);
>
> It does put the cursor at the eof ok, but the eof is not alwise at
the
> bottom of the RE. If the file is shorter as the prev. one, no text
is
> visible, as the eof is then one line above of the top of RE.
>
> How can I fix this that the eof is at the bottom of RE ?

My Delphi may be a little rusty as I have been on holiday but here
goes anyway.

var I: integer;
begin
  I := length (RE.Rext) - 1; // find the last character in RE
  while RE.text[I] in [#10, #13] do
    dec (I); // move back past any terminating CRLFs
  RE.selstart := I; // set your caret on the last non-empty line
  RE.Perform(EM_SCROLLCARET, 0, 0); // now bring your caret int view
end;

// NOT TESTED

--
Henry Bartlett
HABit utilities ( http://www.hotkey.net.au/~hambar/habit/ )
email: hambar@Spamlock.microtech.com.au.
Please remove the "Spamlock." from my address when replying.
> Hi to all and thanks for any replay's.
>
> I'm using RichEdit to display Div. length Text files.
> As I want always to see the end of the files
>  I,m using
> RE.Perform(EM_SCROLLCARET, 0, 0);
>
> It does put the cursor at the eof ok, but the eof is not alwise at
the
> bottom of the RE. If the file is shorter as the prev. one, no text
is
> visible, as the eof is then one line above of the top of RE.
>
> How can I fix this that the eof is at the bottom of RE ?
>
>
>
> Regards Gery
>
> Tanks for any replay


Relevant Pages

  • Re: EM_SCROLLCARET problem
    ... >I'm using RichEdit to display Div. ... >It does put the cursor at the eof ok, but the eof is not alwise at the ... >How can I fix this that the eof is at the bottom of RE? ... Try forcing the cursor to the top of the file before using ...
    (alt.comp.lang.borland-delphi)
  • FW: Html within code
    ... Is coding this way wrong? ... module to write html, but instead do it within the code by using print ... print <<EOF ... <div align=center> ...
    (perl.beginners)
  • Re: ADO Record Count
    ... this was the case that hit me. ... Main factor seems to be the a combination of cursor type and cursor location ... >> try to process records that aren't there. ... Checking EOF and BOF fixed it. ...
    (microsoft.public.vb.database.ado)
  • Re: Data order on response form
    ... The addition to the bottom of the messages has nothing to do with the sender of the email ... - it is added by his anti-virus software on receipt of the email ... plus additional data about the virus protection program, ... | "eofeofeof" so my import program can ignore everything after the 'EOF' ...
    (microsoft.public.frontpage.programming)
  • Re: recno() and "Record is out of range"
    ... recdno, if EOF encountered, then goto the top or bottom. ... on the new filter or an SQL Order By clause or Set Order To. ...
    (microsoft.public.fox.vfp.forms)