10-12-2011 07:31 PM - edited 10-12-2011 07:34 PM
I'm trying to determine if a variable exists, just like I've done many many times in the past and I'm finding this unexpected behavior...
Does anyone have a clue of what could be going on in here?Basically the PropertyExists method evaluates to False but when I add the property to the Watch View it actually returns a valid value
Is this a known issue? (Using TS2010SP1 on W764bit)
Thanks,
<<-N->>
Solved! Go to Solution.
10-12-2011 07:38 PM - edited 10-12-2011 07:38 PM
Solved this problem by using Parameters.Caller.Exists("Step.TekStep.Common.Retry.Grouped",0) to look for the property in the caller context
10-13-2011 01:28 AM
Hi,
PropertyObject.Exists ( lookupString, options)
Returns True if the property exists.
Returns True if the property the lookupString parameter specifies exists.
lookupString As String
[In] Pass the name of a subproperty within the PropertyObject. Refer to Lookup Strings for more information about the strings you can use.
options As Long
[In] Pass 0 to specify the default behavior, or pass one or more PropertyOptions constants. Use the bitwise-OR operator to specify multiple options.
10-13-2011 11:13 AM
Is your Caller parameter a reference? If so this is a known limitation that will be addressed in a future version. The internal issue tracking number is 200893 if you ever need to discuss it with NI. Your work around is the recommended work around.
10-13-2011 04:20 PM
It is a reference indeed, thanks for the CAR info...
03-23-2015 10:52 AM
Still having the same issue in TS 2014. Has this been addressed?
03-24-2015 01:24 PM
It was fixed in TestStand 2012. One thing that might be leading to some confusion though is that you need to leave out the name of the property that the object reference points to. For example:
If you have an object reference variable "Locals.Var1" and that is set to a variable called Var2 which contains a subproperty called Var3 you have to use the lookupstring "Locals.Var1.Var3" to access Var3 rather than "Locals.Var1.Var2.Var3".
Hope this helps,
-Doug
03-27-2015 05:15 PM
Hi Dug, thanks for the response. I think I understand what you're saying, but maybe I don't. Can you explain to me how I should modify my PropertyExists statement in this specific instance so it correctly recognizes the existence of RunState.Root.Sequence.Locals.UUT.SerialNumber, in accordance with your previous post?
Thanks for your time!
03-30-2015 08:08 AM - edited 03-30-2015 08:12 AM
RunState.Root.Sequence.Locals.UUT.SerialNumber is not actually a PropertyObject property path, you should be using RunState.Root.Locals.UUT.SerialNumber instead (without "Sequence"). Your access to "Sequence" is really an API in expressions access to the API property, Sequence, on the SequenceContext interface. It's not a PropertyObject subproperty. You can see this if you look in the variables view under the RunState.Root property while at a breakpoint. There is no "Sequence" subproperty there.
Hope this helps clarify things. Let me know if you have any additional questions regarding this.
-Doug
03-30-2015 06:14 PM
OK. That makes sense. Thank you for taking the time to answer that, Dug!