Posted 09 November 2014 - 10:02 PM
Hello, ComputerCraft Community!
I've been writing the Settings/Control panel app for my OS recently, and I've been working on the user accounts part of the app, and I'm having a bit of a problem.
I'm wanting to make the program take what ever the user enters from a text box, and make it look for certain characters. The reason why I'm wanting to do this is so I don't have users putting spaces in their passwords or usernames, because the API I'm using panics if it finds a space.
Here is the code I have so far:
In summary, I'm wanting to know how to make the program look at the string the user gave it and if it finds, a space or what ever character I want, I want it to tell the user it can't use a space.
If you need more info, or code, just ask!
Thanks!
I've been writing the Settings/Control panel app for my OS recently, and I've been working on the user accounts part of the app, and I'm having a bit of a problem.
I'm wanting to make the program take what ever the user enters from a text box, and make it look for certain characters. The reason why I'm wanting to do this is so I don't have users putting spaces in their passwords or usernames, because the API I'm using panics if it finds a space.
Here is the code I have so far:
local userName = program:GetObject("EnterUsernameBox").Text
local passWord = program:GetObject("EnterPasswordBox").Text
if passWord == "" then
program:DisplayAlertWindow('Password can not be blank!', 'You must enter a password!', {'Ok'}, function(value)end)
end
In summary, I'm wanting to know how to make the program look at the string the user gave it and if it finds, a space or what ever character I want, I want it to tell the user it can't use a space.
If you need more info, or code, just ask!
Thanks!