09-05-2014 10:08 AM
Hi,
From the file - let say file A - from which my Main Sequence is called by Sequential model, I have to call the sub-sequence which is in the other file - let say file B.
What are the ways to cause that FileGlobals from file A will be inherited by the FileGlobals from file B (dynamically, during executions)?
In other words:
FileA:FileGlobals.Settings.Temperature = 5 >----copy? ---parameter pass?--- inherit?---share?-----> FileB:FileGlobals.Settings.Temperature = 5
09-05-2014 10:45 AM
Pass them into the sub-sequence as parameters. If you want universally available variables, use Station Globals.
09-05-2014 11:33 AM
I'm wondering, that it could be good to have an option during the call of the sequence like: "Inherit FileGlobals from the caller". Of course could be area for conflicts, but still see advantage of it.
09-05-2014 11:51 AM
You could place the following statement in your top-level sequence:
Locals.SetPropertyObject("FileGlobals", PropOption_InsertIfMissing | PropOption_NotOwning, FileGlobals),
Locals.SetFlags("FileGlobals", PropOption_NoOptions, Locals.GetFlags("FileGlobals", PropOption_NoOptions) | PropFlags_Propagate)
From then on you can refer to the file globals from within that sequence and any sub-sequence with Locals.FileGlobals.Foo
09-05-2014 12:23 PM - edited 09-05-2014 12:24 PM
I'm sorry but I didn't give the scenario, which I think is important for the answers.
I ask for an advice for it because I have to split up my project by asking another developer to prepare a test sequence. The sequence will be prepared in another file. However, I have to secure the same critical test parameters which, I store in the FileGlobals containers in file A, to be accessible as a FileGlobals from file B. Why? Because, later on maybe I'd like to merge it in to the A file and I'd like to keep the same method of accessing them, avoiding the recopying between containers with different names.
James, your solution wouldn't work for me, as I'd have the FileGlobals from A file accessible from within the Local container in file B.
Crossrulz, passing FG as parameters is the the best solution so far, but I still think that kind of option I mentioned before could bring some advantage.