The Daily Click ::. Forums ::. Klik Coding Help ::. Username Character Allowance
 

Post Reply  Post Oekaki 
 

Posted By Message

Plooscva



Registered
  25/10/2006
Points
  149

Has Donated, Thank You!
19th February, 2007 at 06:17:14 -

In my chat program during registration you're asked to enter your desired username. But the only characters that are allowed are a-z A-Z 0-9 and _. I thought of putting them into list object and then running a loop/loops for so that each character of the username and each letter in the list object gets checked. I tried with loops but didn't exactly work. I would appreciate if someone had a play with it and gave me a detailed explanation/example.

Plooscva

 
n/a

Plooscva



Registered
  25/10/2006
Points
  149

Has Donated, Thank You!
20th February, 2007 at 04:43:56 -

I'm using MMF2. But I rather have a flag that turns on if a illegal character is found in the string and it turns off if every character in the string is found on the list. Deleting doesn't satisfy me.

Plooscva

 
n/a

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
20th February, 2007 at 05:12:25 -

The japanese characters won't like your chat program. Why doesn't looping work?

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Plooscva



Registered
  25/10/2006
Points
  149

Has Donated, Thank You!
20th February, 2007 at 06:25:12 -

Cause I ain't looping it properly ^^. I need to check each character of the username against each letter. So basically Run loop for number of characters in username * Number of allowed characters. And then I'm thinking of modding and dividing it so each letter and each character gets checked. If Disallowed character is found, turn on the flag. If all characters are fine turn it off.

Plooscva

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
20th February, 2007 at 07:33:16 -

Rather than checking against each individual letter with the loop, see if you can get the ascii value for each character (try string parser extensions) and just compare ranges.

 
n/a

Plooscva



Registered
  25/10/2006
Points
  149

Has Donated, Thank You!
20th February, 2007 at 09:59:48 -

With my mate from the Polish Klik Scene we just got the perrrfect solution.

When it's modified, run a loop for number of allowed characters and put the text into string parser.

On loop add to counter number of SubStrings retrieved from string parser 2

Also, have another counter to show the number of characters. If both counters equal, everything is jsut fine (). If they're different, user entered an illegal character. Easy as pie when you got it.

Plooscva

 
n/a
   

Post Reply



 



Advertisement

Worth A Click