Is it save to export (from a DAT) to the parent COMP’s clonestring?
../clone | /admin/COMPDEFS/$COMPTYPE
Above would be a row in a DAT that gets exported
$COMPTYPE is a local variable
Is it save to export (from a DAT) to the parent COMP’s clonestring?
../clone | /admin/COMPDEFS/$COMPTYPE
Above would be a row in a DAT that gets exported
$COMPTYPE is a local variable
This should be fine as long as your DAT is Immune.
the “set_variables” DAT is immune, but the “variables” DAT (currently) isn’t. Should the variables DAT also be immune?
I got a similar example working, but I’m not sure exactly how you’ve set yours up. I discovered that turning on the export flag does not always force the clone to update, Malcolm is going to look at that.
I think your question depends on what you are doing with $COMPTYPE.
I don’t think the local component or the set_variable/variable DATs need to be immune. $COMPTYPE would just end up the same for all clones if they are not immune.
Also, if you have a table
../clone | $COMPTYPE
then you will need an Evaluate DAT after this to evaluate $COMPTYPE and then export from that DAT. Exporting from the table itself reults in “$COMPTYPE” being placed in the Clone parameter, which only works if $COMPTYPE is defined outside the clone, which I was not assuming.
Could you clarify with an example? It should work regardless, I’m just a little foggy on what you have where, or where you are defining your local variables.
$COMPTYPE just holds the “type of the component”, for example “listbox”. In “/admin/COMPDEFS” I have stored one master definition for each of comptype (listbox, menu, button, foo, bar, …)
In each instance (component actually used in the file) I wanna export the clonestring from within the instance, so if $COMPTYPE would be “listbox”, it would export “/admin/COMPDEFS/listbox” to the instance’s clonestring.
So the reason I’m usure if this will work without problems is that I’m not allowed to use local variables in the external tox string. To me it sounds like the same problems should arise when cloning, i.e.:
When the file is loaded, how can the component know what to clone? The clonestring is exported from a DAT inside of the component, but as the component was a clone when the toe was saved, it’s contents is not stored in the toe. Therefore the necessary nodes to export/build the clonestring shouldn’t be available and the cloning should fail. No?
Did that make sense?
If I understand you correctly, then yes, you’d have problems because the necessary nodes would not be there to define the clone string.
But, if you set those nodes that do all the defining for the clone string to immune it should work. The DAT exporting to the clone string would always be there since its is immune, and as long as it is there your clone string will be set correctly.
You can use local variables in the external .tox parameter btw. But I think you are trying to use local variables from inside the component (ie $COMPTYPE is defined inside the component), which you can’t do, since they aren’t local to the parent network where the clone string is set. If you make the local component inside immune as well, so it always exists and always contains $COMPTYPE, then you could use something like this in the clone string to fish out the local variables inside:
/admin/COMPDEFS/tabr("./local/variables", "COMPTYPE", 1)