07-10-2018 05:39 AM
In brief, I need to give below 100 decimal input data as input string like "99".
If I give "121" as input string then need to display pop up a message as check data,
If i give "92" , "91", "1","12","93"
then it is valid data no need to give pop up message.Only have to provide pop up message when invalid data entered by user and not to be display pop up when endtered within range data.
Solved! Go to Solution.
07-10-2018 05:45 AM - edited 07-10-2018 05:46 AM
Hi l12,
some pseudocode:
IF NOT(InRangeAndCoerce(input, limits) THEN OneButtonDialog(Warning) ENDIF
(IF-THEN-ELSE is a case structure, the rest are simple LabVIEW functions.)
You might use a numeric control instead of your string and set its input range to just the allowed values. Much easier than to check values afterwards…
07-10-2018 06:01 AM
Actually, If I need to expects 3 inputs from user, but user has provides only one,or two instead of three then I need to display a pop up message like" please enter all input ".
The same above how can I achieve for different aspects in my .vi file.
Please suggest me a solution.
07-10-2018 06:14 AM
Hi i12,
If I need to expects 3 inputs from user, but user has provides only one,or two instead of three then I need to display a pop up message like" please enter all input ".
Some pseudocode:
IF ArraySize(array of input values) <> 3 THEN OneButtonDialog("Please enter all input!") ENDIF
Seems rather simple to me…
07-10-2018 06:41 AM
In fact, it's a VERY BAD idea to create pop-ups if the user is mistaken.
YOU MUST deprive the user of making mistakes.
In your case, as GerdW correctly noted, you must specify an input range for numeric controls.
In addition, if the "next" button is used, it must be disabled, if the data is not all.
It is even better to set the default values for all input fields, then the user will have to enter less data.
07-10-2018 10:43 AM - edited 07-10-2018 10:45 AM
@Artem.SPb wrote:
In fact, it's a VERY BAD idea to create pop-ups if the user is mistaken.
YOU MUST deprive the user of making mistakes.
In your case, as GerdW correctly noted, you must specify an input range for numeric controls.
In addition, if the "next" button is used, it must be disabled, if the data is not all.
It is even better to set the default values for all input fields, then the user will have to enter less data.
I wouldn't say it's a VERY BAD way of doing it, but using reactive methods to correct input errors dropped out of fashion at about the time DOS did. As mentioned, it's best to prevent the user from entering bad input whenever possible in the first place. If you can do that (and it's not always the case), you don't have to develop code to deal with bad data.
For instance, if an instrument command is 0 for local and 1 for remote, the so-so choices are:
The best way is an enumerated control with Local = 0 and Remote = 1, with digital display enabled, and with the label being the parameter being set. Now the user can only select valid choices, saving us lots of coding effort. (Furthermore, the label gives the user feedback on which parameter is being adjusted, and the item name + digital display ensures that they know what they are setting it to.)
07-11-2018 03:23 AM
@billko wrote:
I wouldn't say it's a VERY BAD way of doing it, but using reactive methods to correct input errors dropped out of fashion at about the time DOS did.
In my opinion, this is not just a "fashion".
Usability experts and psychologists say that when the program "scolds" the user (and the pop-up error message is just such a case), the user finds himself stupid and guilty. He does not scold the programmer or program, but blames himself for the error and loses the desire to work with the program.
And I do not want users of my programs to consider themselves stupid and lose interest in the work 🙂
07-11-2018 07:19 AM
@Artem.SPb wrote:
@billko wrote:
I wouldn't say it's a VERY BAD way of doing it, but using reactive methods to correct input errors dropped out of fashion at about the time DOS did.
In my opinion, this is not just a "fashion".
Usability experts and psychologists say that when the program "scolds" the user (and the pop-up error message is just such a case), the user finds himself stupid and guilty. He does not scold the programmer or program, but blames himself for the error and loses the desire to work with the program.
And I do not want users of my programs to consider themselves stupid and lose interest in the work 🙂
I always just assumed I was stupid and uninterested in my work; I had no idea I was being coerced! 😉