How to suppress the Modal Purge dialog? -- Name space conflict

R.H. roland.huettmann at gmail.com
Sun Sep 19 17:52:23 EDT 2021


Hi everyone

I have a need to programmatically open about 200 stacks, do something, and
the close them. In this case, for documentation reasons, I take a
screenshot from every stack, every card, and every substack and their cards
to export it.

My problem is that there are number of stacks that have the same stack name
(apart from a different file name), and loading them into memory (opening
them) sometimes creates a naming conflict if a stack with the same name
already is loaded -- and these are library stacks, etc.

The known modal dialog appears to allow to purge such stack. This dialog
seems to appear before even any error message could be intercepted.

Can this purging be automated and the dialog be suppressed? I found no way
(using the "try" construct, locking messages, etc.) to suppress this dialog
and just do the purge from script.

I assume that it could eventually be done messing with the strack in the
IDE that generates the dialog. But I do not really want to do this for
principle reasons.

Another way is to make sure that there are never same stack names (which
are only known after opening), but that is almost impossible to control and
might break certain stack relationships -- and I am not just talking about
my own stacks, but also stacks from third parties, and opens sources.

Of course, I can make sure that there are is never more than the main stack
in memory before opening any other stack -- except the IDE stacks. But in
my special case this is not a good solution as the app relies heavily on a
number of open stacks. At least, I am still trying to find a better
solution.

Maybe a good feature for future would be to support name spaces as in other
development environments so that such naming conflicts may be avoided.
Stacks and other resources could then share a name space, and then there is
only the need to have unique names within such name space. Some people
(including myself) already mimic this using prefixes to a name. But that is
just a starting point and difficult to control. The concept of name spaces
goes beyond that.

Any ideas ? )))

have fun...
Roland



More information about the use-livecode mailing list