LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

password

Solved!
Go to solution

very true I will have to figure out away to get rid of that error

 

thanks elset191

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 11 of 21
(1,432 Views)

I wrote a little VI that tests this.  There are two parts to it.  One is if you wanted the username to be able to contain spaces between text.  And another if you want to disallow any spaces.  I did a quick test, but it may not be fully debugged.  There are almost certainly other ways to do it too.

 

check.PNG

 

 

edit:  I just realized that the bottom version allows a blank string to go through.  So you could either check to make sure the length > 0 (which I think you already do) Or check to make sure it doesn't equal the empty constant.

Message Edited by elset191 on 06-19-2009 10:15 AM
--
Tim Elsey
Certified LabVIEW Architect
Message 12 of 21
(1,423 Views)

I added some other things to is that where recommended and I still see to be getting errors I think it is because of the case structures I am using in the create a pasword and create a Ursername

 

here is passwordtime.6

 

 

thanks,

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 13 of 21
(1,416 Views)

A few quick things.  When you check for length use >6, not equal to 6. 

 

You have to or ALL of the errors.  I.e. if the length i s < 6 you still let it pass because you do not or that error with the no spaces error. 

If there are no spaces and the lenght is <6 the true case of the last case structure will be executed and add the new things into the arrays. 

 

You can still enter a blank username.  See my comment above.

 

Instead of using a for loop to index all of your usernames to search for a duplicate use Search 1D array.  This will return -1 if it is not found.  This will save you the trouble of indexing through possibly thousands of usernames before finding a duplicate.  (Assuming the search implemented by labview is halfway decent.)

 

And a not functional suggestion.  You don't need separate strings and submit buttons for signing in and creating.  You can put these on top of (but not inside) the tab control and then just use a case structure for value of tab control to decide how to treat the inputs.  Or you can use a simple boolean instead of a tab control.

Message Edited by elset191 on 06-19-2009 11:01 AM
--
Tim Elsey
Certified LabVIEW Architect
Message 14 of 21
(1,413 Views)
yes I did mess that up i ment to put less than
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 15 of 21
(1,410 Views)
Ok so now it no longer allows you to enter in an empty string:)
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 16 of 21
(1,405 Views)

I don't know why but I put an and instead of an or where it checks for spaces

 

sorry guys,

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 17 of 21
(1,404 Views)

When I enter a blank name in your version I get the error, but it still adds it to the array.

 

 

 

Instead of doing my own work at work I worked on this and cleaned it up a bit.  Take a look.

Message Edited by elset191 on 06-19-2009 11:48 AM
--
Tim Elsey
Certified LabVIEW Architect
Message 18 of 21
(1,401 Views)

funny it didn't do that for mine hmmmm

 

your code is very clean

 

thank you for all the help,

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 19 of 21
(1,399 Views)

You're welcome. 

 

Another thing to consider is if you want your usernames/passwords to be case sensitive.  If not, there are To Upper and To Lower functions you can use to make everything uniform case.

 

I also found another bug.  Any whitespace except a space is still permitted.  For example i typed asdf(enter)asdf and it was accepted.  I have attached a version that fixes this (I think)


Message Edited by elset191 on 06-19-2009 12:32 PM
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 20 of 21
(1,391 Views)