06-13-2013 06:14 AM
in my sequence I collect some data into a Local.Result container. I have a lot of sequences, and I plan to collect all of these local containers in an array of containers in StationGlobals. The local containers in each sequence are built up identical.
I tried to use the Clone method, but I!m stucking with it. I could use the NewSubProperty method on each element of the container in each element of the StationGlobal array, but I there must me an easy way to copy the container.
Any idea?
06-13-2013 08:38 AM
06-13-2013 10:52 AM
Clone should work. What problems were you having with it?
-Doug
06-14-2013 12:44 AM
The problem is, how to do it? Can you provide a small example?
06-14-2013 10:56 AM
I think what you are wanting is something like this:
StationGlobals.ResultArray.SetPropertyObjectByOffset(StationGlobals.ResultArray.GetNumElements(), PropOption_InsertElement, Locals.Result.Clone("", PropOption_DoNotShareProperties | PropOption_CopyAllFlags))
One caveat to all this is that it sounds like you are trying to re-invent result collection, which is an already built-in feature of TestStand (i.e. That's what Locals.ResultList is for). I would strongly recommend against doing so, unless you have a very good reason. By not using the standard result collection mechanism you will be missing out on a lot of the functionality of TestStand and likely find yourself having to re-invent some of it.
Hope this helps,
-Doug