#44790 - 2003-09-04 04:48 PM
Validate Input
|
@lejo @rias
Starting to like KiXtart
Registered: 2003-09-02
Posts: 100
Loc: Medellin, Colombia
|
Hi, I need validate a Input from user, in this code for example:
Color b+/n Box (0,0,24,79,GRID) ; FONDO CUADRADO Color b/n Box (8,21,18,61,Ć) ; SOMBRA CAJA Color g+/n Box (7,20,17,60,FULL) ; CAJA VERDE Color w+/n At (10,22) "Código Sucursal Anterior: " Color r+ $SucAnt ; Mostrar mensajes solicitud codigos sucursales Color w+/n At (12,22) "Digite Código Sucursal Actual: " Gets $SucAct Color w+/n At (14,22) "Código Asesor, ej, 50,51,52: " Gets $CodAse
I need that $SucAct, be number and only have 3 characters.
_________________________
Look always 4 the best...
|
|
Top
|
|
|
|
#44791 - 2003-09-04 04:54 PM
Re: Validate Input
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
code:
do At (12,22) "Digite Código Sucursal Actual: " Gets $SucAct until val($SucAct) >= 100 and val($SucAct) <= 999 and len($SucAct) = 3
|
|
Top
|
|
|
|
#44792 - 2003-09-04 04:57 PM
Re: Validate Input
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Try this:
code:
Color b+/n Box (0,0,24,79,GRID) ; FONDO CUADRADO Color b/n Box (8,21,18,61,Ć) ; SOMBRA CAJA Color g+/n Box (7,20,17,60,FULL) ; CAJA VERDE Color w+/n At (10,22) "Código Sucursal Anterior: " Color r+ $SucAnt ; Mostrar mensajes solicitud codigos sucursales While Not $SucAct Color w+/n At (12,22) "Digite Código Sucursal Actual: " At(12,53) Gets $SucAct If Cstr(Val($SucAct))<>$SucAct OR Len(Val($SucAct))<>3 At(14,22) Color r+/n "Must be a 3 digit number!" $SucAct="" EndIf Loop Color w+/n At (14,22) "Código Asesor, ej, 50,51,52: " Gets $CodAse
|
|
Top
|
|
|
|
#44793 - 2003-09-04 05:08 PM
Re: Validate Input
|
@lejo @rias
Starting to like KiXtart
Registered: 2003-09-02
Posts: 100
Loc: Medellin, Colombia
|
Tks, it works...
_________________________
Look always 4 the best...
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|