script scope variables inexplicably becoming unset
J. Landman Gay
jacque at hyperactivesw.com
Wed Dec 31 12:51:49 EST 2014
On 12/31/2014 10:36 AM, Dr. Hawkins wrote:
> somehow, chStk changes from a value
> to empty about where the palette opens, even with messages locked-
Again, any time you change stacks the focus will change. When that
happens the selection usually gets wiped. Locking messages won't help in
this situation; that just means the engine won't send event reports to
your scripts but it doesn't change how the engine behaves.
Clicking on something, opening something, etc. usually removes the
selection, which should be considered as temporary as "the result" or
"it". (List fields are an exception because they store the hilitedline
natively.) It will usually still be there if nothing else happens, but
in this case you are opening another stack and using an answer dialog,
both of which change the focus.
The best approach is to store the selection in a variable before you do
anything else, if you are going to need it later.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list