From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Message popup Validation

Hi,

 

When using a message popup how best can validation be done?

 

I need to check that the used has entered 3 letters.

 

Thanks

Simon

0 Kudos
Message 1 of 4
(4,307 Views)

Simon,

 

easiest solution would be to make the "sanity" check in a code module which also is the popup. Depending on the parameters of the check, you should pass appropriate values to the module.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(4,304 Views)

If you use the standard "Message Popup" step you can determine the length of the user input within the Step's Post-Expression.

Say you create a Local variable "input_valid" and use the following post-Expression in the Message Popup step:

 

Len(Step.Result.Response) == 3 ? (Locals.input_valid = True) : (Locals.input_valid = False)

 

Then you can expand from there with e.g. a while loop around the Message Popup.

This does not quite fulfil your requirement though as it only checks for the length of the user input and not whether it has three letters.Could as well be two letters and a number. But maybe that is already good enough for you, in this case you wouldn't need a code module.

Message 3 of 4
(4,295 Views)

Hi,

Thanks for the reply’s.

 

I was hoping to stay away from a code module to check, feeling a bit lazy, so the minimum 3 charter entry is a start for the moment untill I get around to a more comprehensive check.

 

Thanks

Simon

0 Kudos
Message 4 of 4
(4,281 Views)