Click to See Complete Forum and Search --> : How do I force certain input?
vic102482
12-13-2002, 07:37 PM
I have an input type promt for the user, but I want to make it so that they user cannot enter in any letters (a-z) only numbers. How do I do this?
Whoops sorry, I am using Perl programming laungaue
chris_i386
12-13-2002, 07:51 PM
If you say wich programming language you are using, others may be able to help you... ;)
while(1)
12-14-2002, 10:16 PM
Using a normal command prompt you are going to have a hard time preventing the user from entering letter .. but you can just verify the input and spit it back to the user it it contains letter...
OO
chris_i386
12-15-2002, 10:39 AM
I can't help you with Perl, but I'll bump this thread up for you!
...bump!
vic102482
12-15-2002, 10:54 AM
How do I spit back an error message?
would it be
unless ($b <=0 or $b >=0){do this?}
while(1)
12-16-2002, 01:32 PM
I dont really use Perl (Python!!) but you could simply do:
> do a regex to check for letters
or
> treat the input as an array and go through it char by char and check its value
OO
vic102482
12-16-2002, 01:49 PM
I will definatly check that out!
What is Python anyways?
while(1)
12-16-2002, 04:40 PM
Python (www.python.org) is a scripting language much like perl, but newer and (I think) a little better.
BUT, a lot of people will tell you that Perl is better, or Ruby or .. or ..
Whichever you feel comfortable with is probably the better choice for you.
OO