LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid the user to type the double quotes ( " ) in the front panel?

How to avoid the user to type the double quotes ( " ) in the front panel? I am using the csv format file to store the user information. So, user should not use the double quote(  " ). So, kindly reply............
0 Kudos
Message 1 of 8
(3,642 Views)

I don't understand why they need the double quotes in the first place.

Does the Front Panel use a String Control for user input?  Do you actually want the "  "  when storing the data?  If so, then you can add the quotes after the user has input the data.

Describe what you want and I can show you an example.

RayR

0 Kudos
Message 2 of 8
(3,615 Views)

I'll take a guess at the fact that you want to have quotes for the cvs file, but do not want the user to put quotes.

Look at the example below.  If you do not put quotes in a string control, it does the same as text-based languages and treats the input as "input text".  But you don't need quotes, because it is already a string.

If you want to have quotes, but only for the cvs file, then look at the two methods.  It is good to use the format into string, it's a cleaner way to program (my personal taste). 

You can also add features like detecting if there are quotes at the beginning & end and not place quotes if they are already there, etc.

Hope this helps.  Sorry if I misunderstood the question.

RayR



Message Edited by JoeLabView on 12-13-2007 08:18 AM
0 Kudos
Message 3 of 8
(3,610 Views)
You can use a filtering event for "key down?" for the desired controls and discard if the key is a double quote.
 


Message Edited by altenbach on 12-13-2007 08:38 AM
Message 4 of 8
(3,588 Views)

Very nice Altenbach.

That's why your the wizzard 🙂

 

The only proble I see with your solution is that it would erase any double quotes within the text, not just the leading and ending quotes..

Example:

Quoted Text:

"Mary who has a little lamb said "Hello", while tending to her lamb"

What if you wanted the unquoted version:

Mary who has a little lamb said "Hello", while tending to her lamb

You'd need to preserve the quotes within the text.

Other than that I like your approach.

RayR



Message Edited by JoeLabView on 12-13-2007 01:47 PM
0 Kudos
Message 5 of 8
(3,570 Views)
Thanx for the reply. You have understood the problem correctly. I have used the "User information" Express vi, so in that if the user types in the double quotes then it should not be accepted. Is there an way to display message stating that, Double quotes not allowed, same as the message pop's up when capslock is on when typing the password while logging in windows...
0 Kudos
Message 6 of 8
(3,547 Views)
Thanx for the reply. You have understood the problem correctly. I have used the "User information" Express vi, so in that if the user types in the double quotes then it should not be accepted. Is there an way to display message stating that, Double quotes not allowed, same as the message pop's up when capslock is on when typing the password while logging in windows...
0 Kudos
Message 7 of 8
(3,546 Views)

Very simple actually.. Modify Altenbach's example to add a popup message. 

So as soon as you hit the double quote button, a pop-up appears.  Use a single button popup.

0 Kudos
Message 8 of 8
(3,513 Views)