#24504 - 2002-07-06 03:35 PM
Limiting string input
|
zenart
Lurker
Registered: 2002-06-13
Posts: 4
Loc: melb
|
Hi I have a simple question,
I am writting a script where I ask the user to input a three digit string.
AT (5,10) " Enter the three Digit Machine ID " AT (6,10) " (eg 601) : " Gets $IMAGE
How do I limit the input to only three digits and how to I stop spaces from being inputed as part of the string.
???
|
|
Top
|
|
|
|
#24510 - 2002-07-08 01:26 PM
Re: Limiting string input
|
zenart
Lurker
Registered: 2002-06-13
Posts: 4
Loc: melb
|
YE thank for that I like jpols suggestion,
But what about a carriage return. How would i filter that out
|
|
Top
|
|
|
|
#24513 - 2002-07-09 11:43 AM
Re: Limiting string input
|
zenart
Lurker
Registered: 2002-06-13
Posts: 4
Loc: melb
|
The example below works well thanks for all your help.
if len($image) <> 3 or instr($image," ")
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 302 anonymous users online.
|
|
|