Re: Adding string to Memo



Brian" <not@xxxxxxxxx> wrote in message
news:VRM8f.36915$S_1.27676@xxxxxxxxxxxxxxxxxxxxxxx

> if SelStart gives me the position, how do I then say
> add the 'string' at the position?

Try something like this

S := MyMemo.Text;
MyMemo.SelLength := 0;
Insert (StringToBeInserted, S, MyMemo.SelStart);
MyMemo.Text := S;

HTH

--
Henry Bartlett
Delphi Links Page:
( http://www.hotkey.net.au/~hambar/habit/delflink.htm )


"Brian" <not@xxxxxxxxx> wrote in message
news:VRM8f.36915$S_1.27676@xxxxxxxxxxxxxxxxxxxxxxx
>
> > Memo.SelStart gives you the position,
> > where you should insert your text into Memo.Text .
> > If Memo.SelLenght is not 0,
> > you might want to replace this amount of chars
> > by your text.
> >
> > Regards
> > Heiner
>
>
> Thanks for such a quick response, little confused
>
> Brian
>
>




.



Relevant Pages

  • Regex help
    ... I'm trying to create a regex and I can't quite seem to get it right... ... I'm trying to get several arguments out of a string which looks like: ... Brian ... Prev by Date: ...
    (comp.lang.java.programmer)
  • Re: RTF2 Report (across multiple pages)
    ... Lets' go back to the start on your SelStart issue. ... Dim sdd As String ... Dim QWE As Integer ...
    (comp.databases.ms-access)
  • Re: get mixins name
    ... > module defines an instance method which returns the name of the module ... The string is simple though... ... Brian. ... Prev by Date: ...
    (comp.lang.ruby)
  • Re: Adding string to Memo
    ... if SelStart gives me the position, ... add the 'string' at the position? ... Brian ... Prev by Date: ...
    (alt.comp.lang.borland-delphi)
  • Re: Strange Replace problems
    ... the RTB. ... You have: mSelText = .txtEdit.SelText ... Then you ran Replace on that string. ... > .txtEdit.SelStart = SelStart ...
    (microsoft.public.vb.general.discussion)