LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to discard non alphanumeric key in a string ?

Solved!
Go to solution

Dear all,

 

To start an application  that i have developped, i would like that the user write its password in the first panel but i want that each time that user enter a character in the string control Hide_Password (see attached picture), this one is automatically convert in a "." to hide the password . The real password is saved in a second string control. It is actually what my vi is doing by using a Key Up event. But now i want to prevent any non alphanumerical character to be enter in the password, especially i do not want that the user can press the menu key as <Ctrl>, <Shift>, <Alt>, <Command>, and <Option> and also the <Left>, <Up>, <Right>, <Down>. I suppose that i have to use Key Down? event by discarding all the key that i do not want but i am sure that there is a more easy way to do it.

Do you have any idea ?

Morover, If you think that there is something wrong in my vi, please let me know.

 

Thanks

Philippe 

Download All
0 Kudos
Message 1 of 7
(3,987 Views)

If you don't want the display to show the users typing, why not just use Password mode on the string control.

I might misunderstand what you are trying to achieve.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 7
(3,972 Views)

Lexical Class Function   <<<Edit thats a link

but why not just set the display style to *?

 

 

EDIT: Whats with the font?


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 7
(3,971 Views)
Solution
Accepted by topic author mnemo15

You can also use the string control Key Down? event and discard the event when the ascii char do not correspond to an alphanumerical character.

 

FilterCharacter.png

 

Ben64

Message 4 of 7
(3,961 Views)

Thanks for the password mode of STRING, i did not know that there is this option. It is perfect. But now i have to prevent the special key to be pressed....

0 Kudos
Message 5 of 7
(3,953 Views)

Thanks Ben64,

it is exactly what i want... but not enough knowledge to do it so easily.

 

0 Kudos
Message 6 of 7
(3,950 Views)

The real password is saved in a second string control.

One thing you shouldn't do is use a (hidden?) String control for data storage.  Use the one control for data input (as a password as others have suggested) and pass the data throughout your program with a wire.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 7
(3,947 Views)