ID:155612
 
            var/bannedcharacters = list("1","2") // creates the list and what i want in it
start // sets a restart point
var/charname = input("Choose name","Name",key) as text // choose name
for(bannedcharacters in charname) //look for anything in the bannedcharacters list in their name
if(bannedcharacters) // if they did find a bannedcharacter in their name
goto start // go to the restart point
... // if they're not redirected then the proc continues and they go here


You dont have to actually tell me how to do it, I mostly just want to know why this didnt work? I put my understanding of what i was doing in the notes.

Thanks
Turles wrote:
>           var/bannedcharacters = list("1","2") // creates the list and what i want in it
> start // sets a restart point
> var/charname = input("Choose name","Name",key) as text // choose name
> for(bannedcharacters in charname) //look for anything in the bannedcharacters list in their name
> if(bannedcharacters) // if they did find a bannedcharacter in their name
> goto start // go to the restart point
> ... // if they're not redirected then the proc continues and they go here
>

You dont have to actually tell me how to do it, I mostly just want to know why this didnt work? I put my understanding of what i was doing in the notes.

Thanks

goto is bad and you should be using findtext() when looking for text.

Edit: Garthor wrote up nice little thing on filtering specific characters.
In response to LordAndrew
Alright i think i understand, for() cant pick apart a var by character unless i use copytext() to search through the text of the var like Garthor did.

I tried using findtext() but i was kind of confused on the arguments, ill look more into it. Thanks.