SelectedChunk

Peter Brigham MD pmbrig at gmail.com
Mon Sep 27 13:39:32 EDT 2010


The selectedChunk gives the segment of text selected, in the form

   char <chartPosition> to <endPosition> of field <n>

If the selection is empty (insertion point only), the result is  
something like "char 5 to 4 of field 9" -- in this case to get the  
number of the word containing the insertion point, use:

   the number of words of char 1 to (word 4 of the selectedchunk) of  
field 9

If a run of text is selected then the above will get the number of the  
word containing the end of the selection.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig



On Sep 27, 2010, at 9:17 AM, Warren Kuhl wrote:

> Is there an easy way to retrieve the word # of a field based on the
> SelectedChunk?  The SelectedChunk contains the start/end position of  
> a word
> of a field.  Just am trying to determine which word without to much
> coding...if possible.
>
> Thanks for any help!
> Warren
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list