Location of the insertion point in a field

Thomas McGrath III 3mcgrath at adelphia.net
Mon Mar 21 07:44:55 EST 2005


How do I find out where the insertion point is?

You use the selectedChunk function to find out the location of the 
insertion point.

When there is an insertion point but no text is selected, the 
selectedChunk function returns an expression of the form char nextChar 
to prevChar of field fieldNumber. For example, if the insertion point 
is in field 3, between character 10 and character 11, the selectedChunk 
function returns char 11 to 10 of field 3.


How do I place the insertion point in a field?

You use the select command to place the insertion point in a field.

If you use the select command with the before or after keyword, it 
places the insertion point at the location you specify. The following 
examples show how to place an insertion point at various points in a 
field's text:

   select before text of field "My Field" -- at start of text
   select after text of field ID 3452 -- at end of text
   select before line 3 of field 1 -- start of line 3
   select after char 22 of field 5 -- between char 22 and 23
On Mar 20, 2005, at 8:02 PM, Mikey wrote:

> Well, I tried searching the docs.
> How do I figure out where the cursor (insertion point) is in a field?

Thomas J. McGrath III
SCS
1000 Killarney Dr.
Pittsburgh, PA 15234
412-885-8541


More information about the use-livecode mailing list