gettingstarted
[Top] [All Lists]

Re: Position of the cursor (insertion) point

To: "Getting Started" <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Position of the cursor (insertion) point
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Tue, 30 Sep 2003 08:43:11 -0500
References: <B30676EB-F2F9-11D7-80D3-003065D91F8C at earthlink dot net>
At 11:53 PM -0400 9/29/03, Wayne Dreier wrote:

If I copy text from an editfield and then paste it into a different editfield the paste leaves the cursor (insertion) point at the end of the pasted text. If I then paste again, the second paste gets added to the text already there.

Right.

Is there a way to position the cursor at the end of any text in an editfield so that I might get text from an editfield, put it into T which has been dimmed as a string and then merely do editfield2.text = T.

Yes, you can do exactly what you describe.

 Will this add the text or will it still replace what was there?

It will replace what's there. You're assigning to editfield2.text; that says "make editfield2's text be the contents of T". So that's whaht RB does.

It's not clear from your question, but if what you really want is to imitate the Paste behavior you describe above, then you should assign to EditField2.SelText. That replaces the selected text (or inserts it at the insertion point, which is just a case where the length of the selection is zero) with the given new text.

I haven't figured out how to position the cursor so I can't test it myself.

Simply assign to EditField2.SelStart (and perhaps .SelLength).

Cheers,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout           REAL Software, Inc.                |
|    joe at realsoftware dot com       http://www.realsoftware.com        |
`------------------------------------------------------------------'

- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>