Changing component instance
Author: richard.gill@agfa.com (richard.gill)
Hi
I discovered recently one DSP can ask its container to change the value in the container (so the DSP which makes the request). This not work, until you clearly define scopes to limit the current DSP to input :
PARENT
+- DSPCONT = CHILD1
CHILD1: BUTTON.detail
scope
input
endscope
activate "PARENT".changeChild()
PARENT.changeChild
DSPCONT = CHILD2
But this does not work when the child is a fixed name instance.
PARENT.exec
scope
output
endscope
newinstance "CHILD1", "CHILD"
DSPCONT = "CHILD"
CHILD1: BUTTON.detail
scope
input
endscope
activate "PARENT".changeChild()
PARENT.changeChild
DSPCONT = ""
deleteinstance "CHILD"
newinstance "CHILD2", "CHILD"
DSPCONT = "CHILD"
In the changeChild operation, the deleteinstance stop ANY processing (even in the debugger, debugging stop their and we have a runtime error). If we remove the deleteinstance, the newinstance does not work (-154 : instance already exists ).
No way to make this work? (I tried with a button in the parent changing the component affected to the DSPContainer, same result)