restore selection from selectedChunk expression

Sannyasin Brahmanathaswami brahma at hindu.org
Sat Aug 1 04:05:41 EDT 2015


But I want to re-select the text later,
not set the background color

BR



> On Jul 31, 2015, at 8:05 PM, J. Landman Gay <jacque at hyperactivesw.com> wrote:
>
>> 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
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the Use-livecode mailing list