restore selection from selectedChunk expression
J. Landman Gay
jacque at hyperactivesw.com
Sat Aug 1 02:05:42 EDT 2015
On 7/31/2015 5:52 PM, Brahmanathaswami wrote:
> If we make a text selection and store it as a selectedChunk string
>
> e.g
>
> gCurrentSelection
>
>
> which them would have say... a value of
>
> char 669 to 1094 of field 6
>
> How to I re-select that text?
>
> global gCurrentSelection
> on mouseUp
> set the backgroundcolor of gCurrentSelection to yellow
> end mouseUp
>
> works'
>
> but
>
> global gCurrentSelection
> on mouseUp
> selectgCurrentSelection
> end mouseUp
>
> does not... an i can't find a way to re-set the selection ....
I like to avoid "do" because that requires an on-the-fly compilation, so
I generally use this:
set the backgroundcolor of char (word 2 of gCurrentSelection) to (word 4
of gCurrentSelection) of fld "somefield" to "yellow"
Or if the field will vary:
set the backgroundcolor of char (word 2 of gCurrentSelection) to (word 4
of gCurrentSelection) of fld (last word of gCurrentSelection) to "yellow"
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list