restore selection from selectedChunk expression

Paul Dupuis paul at
Sat Aug 1 12:06:11 EDT 2015

On 7/31/2015 6:52 PM, Brahmanathaswami wrote:
> global gCurrentSelection
> on mouseUp
>   selectgCurrentSelection
> end mouseUp
> does not... an i can't find a way to re-set the selection ....

In LiveCode 6.7.5, I just created a test stack with the following: A
field with some text in it and 2 buttons with the following scripts:
Button 1
on mouseUp
  global gSelectedChunk
  put the selectedChunk into gSelectedChunk
end mouseUp

Button 2
on mouseUp
  global gSelectedChunk
  select gSelectedChunk
end mosueUp

Selecting some text, clicking button 1, clicking elsewhere in the field
to deselect (so I can see if button 2 works) and clicking button 2,
correctly select the chuck originally selected.

What version of LC are you using? Perhaps being unable to execute
"select gCurrentSelection" (assuming gCurrentSelection has a valid chunk
expression) is a bug fixed in later version of LC.

More information about the Use-livecode mailing list