Jacque demonstrated a point, you don’t have to use the whole of 
gCurrentSelection as part of the script in one go, you can extract the parts 
you need to reconstruct the selection, it’s pretty easy to adapt the examples 
she gave;

 select char (word 2 of gCurrentSelection) to (word 4 of gCurrentSelection) of 
fld (last word of gCurrentSelection)

Paul


> On Aug 1, 2015, at 01:05, Sannyasin Brahmanathaswami <bra...@hindu.org> wrote:
> 
> 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 <jac...@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         |     jac...@hyperactivesw.com
>> HyperActive Software           |     http://www.hyperactivesw.com
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



Regards,

Paul Hibbert
p...@livecode.org




_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to