I have a parent interface that is calling a sub-interface. I want to use a!save() is this possible?
Discussion posts and replies are publicly visible
Hello,
You will have to send ri to subinterface first.
Then use save!() in the subinterface to update it.
This will return backthe changed ri.
Yes, if you pass the ri! as a parameter of the rule that makes the sub-interface, then when you update the value inside that code, it will proceed to update it outside that code as well. In your sub-interface, it can have a completely different name, but that's not recommended. You have to a!save() into the name the parameter has in the sub-interface.
It's actually VERY good practice to explicitly label all the ways the data flows down through the nested code then back up through the nested code. Developers can track where a starting value comes from, and where a changed value ultimately goes.
It's worth noting the conceptually any ri! parameter is simply a "pointer' to a variable. That variable needs to exist in the parent interface object (or, if there is a stack of calls, at the very top-most interface) for the value to be changed from a sub-interface.