mob/var
Names=list()
Legals=list("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")
mob/verb
Create()
Step1
var/Name=input("Please enter your name. 4-16 characters","Name",usr.key)as text
if(!Name)
goto Step1
if(length(Name)<4)
usr<<"Your name must be between 4-16 characters!"
goto Step1
if(length(Name)>16)
usr<<"Your name must be between 4-16 characters!"
goto Step1
else
var/N=lowertext(Name)
if(N in Names)
usr<<"This name already exists, please find a new one!"
goto Step1
else
var/Firstletter=copytext(N,1,2)
if(Firstletter in Legals)
Firstletter=uppertext(Firstletter)
var/Afterletters=copytext(N,2,0)
Afterletters=lowertext(Afterletters)
Name="[Firstletter][Afterletters]"
usr<<"[Name]"
Names+=N
else
usr<<"Your name cannot contain any illegal characters outside of A-Z!"
goto Step1
But what I am wondering is a few questions.
1) Is this an efficient way to do this or no.
2) How do you check all the letters after the first one for illegal characters???
Yes.
See below.
-- Data