05-01-2016 04:38 AM
Hello everyone,
I have a really easy question, I need an expression to detect a null refnum.
I am sending the StationGlobals.TS.CurrentUser.LoginName from TestStand to the User Interface via the FrontEndCallback.seq using the UIMessage. There are times when the StationGlobals.TS.CurrentUser does not exist (i.e. when the user click on the 'Cancel' button of the Login Dialog). I want to detect this situation by checking if the StationGlobals.TS.CurrentUser is a null refnum. I tried the following expression such as
StationGlobals.TS.CurrentUser == Null
or
StationGlobals.TS.CurrentUser == null
but they all do not work.
Can anyone please tell me the expression to detect a null refnum?
Thanks for reading
hlim
Solved! Go to Solution.
05-02-2016 04:14 AM
You might want to try Nothing instead of Null
05-02-2016 04:24 AM
I have tried Nothing, but it still does not work. I am thinking of using the StationGlobals.TS.hasAttribute API.
05-02-2016 04:30 AM
Sorry, didn't read your post properly....
StationGlobals.TS.CurrentUser is of type container. For checking if it has been created, you can use the PropertyExists API function
05-02-2016 08:17 AM
Hello Oli Wachno,
thanks for your big help. PropertyExists method works for me! I added the PropertyExists("StationGlobals.TS.CurrentUser") in the precondition of the step. This works very well.
Sincerely,
Huck