Notifications
Clear all
[Closed] I hate you on isChecked
Feb 21, 2008 6:02 pm
How come something like this:
macroScript test
category: "testcripts"
(
on isChecked do testfloater != undefined
on execute do (global testfloater = newRolloutFloater "testfloater" 201 600 20 70 )
on closeDialogs do
(
closeRolloutFloater testfloater
testfloater = undefined
)
)
works ok if I evaluate the script manually but on restarting MAX and pressing the button it creates a new instance of the floater repeatedly.
Re-evaluating the code manually once agains makes the code work ok… what am I doing wrong?
2 Replies
Feb 21, 2008 6:02 pm
this looks like global/local scope issue … if you change it like this:
(
global testfloater
on isChecked do (testfloater != undefined)
on execute do (testfloater = newRolloutFloater "testfloater" 201 600 20 70 )
...
and it sees the one and only testfloater ( or so me think … )