10-30-2012 06:47 PM
Hi:
I don't understand the difference between the "RunState.Step" and the "ThisContext.RunState.step".Can someone explain for me?
Any help appreciated!
10-31-2012 10:06 AM
Yes they are the same. "ThisContext" is just a self-referential pointer back to the context (which is the root-level object in this case). You can even do "ThisContext.ThisContext.ThisContext." for however long you want. The purpose of "ThisContext" is for when you need to pass the context itself as a parameter to a code module or something similar.
Hope this helps,
-Doug
10-31-2012 11:12 AM
Hi:
Doug,thank you for your repaly! Just i want to know that which conditions we can use "RunState.Step" and which conditions we can use "ThisContext.RunState.Step".Maybe the conditions in which they are used are the same fully? Any help appreciated!
11-01-2012 09:47 AM
The only reason to ever use ThisContext is if you want to pass the current context itself somewhere. It's like a "this" pointer in C++. It's harmless and ok to do "ThisContext.RunState.Step" it's just unnecessary and the same as just doing "Step" or "RunState.Step". The expressions Step, RunState.Step, and ThisContext.RunState.Step all refer to the same thing.
-Doug
11-01-2012 06:16 PM
Hi:
Thank Doug's reply.I also have a question that whether RunState inherits from ThisContext.RunState. And what is the relationship between "RunState"and
"ThisContext.RunState"? Waiting response imperatively!
11-02-2012 09:51 AM
They are the same property. Some properties in TestStand are aliases/pointers to properties that already exist elsewhere. This is such a case.
-Doug
11-02-2012 06:05 PM
Hi:
What about the "RunState" and the "ThisContext.RunState"?
11-05-2012 03:54 AM
Hm..... repeating the same question over and over again is not giving you different answers.
As Doug already stated:
ThisContext is a recursive "this" pointer to the whole data set of your execution.
You should get familiar with the concept of this pointers if you don't understand the answer Doug already provided some postings ago....
Norbert
11-05-2012 10:03 AM
@xiaochan wrote:
Hi:
What about the "RunState" and the "ThisContext.RunState"?
In case it wasn't clear, my last answer was in regards to these two properties.
-Doug