Pascal/Turbo Pascal - AYUDA VALIDAR SOLO LETRAS O TEXTO EN PASCAL

 
Vista:
sin imagen de perfil

AYUDA VALIDAR SOLO LETRAS O TEXTO EN PASCAL

Publicado por elias (45 intervenciones) el 22/11/2012 23:41:24
Necesito validar la entrada de datos nombres y apellidos por ejemplo que sean solo letras o texto, que el campo no este vacío...esto es lo que hice...

1
2
3
4
5
6
7
Repeat
Write('           Ingrese Nombres y Apellidos:   ');
ReadLn(Reg.Nom);
if Reg.Nom= '' then
WriteLn('Debe Escribir el Nombre del Estudiante');
until
Reg.Nom <> '';
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

AYUDA VALIDAR SOLO LETRAS O TEXTO EN PASCAL

Publicado por ramon (2158 intervenciones) el 23/11/2012 16:09:06
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{Esto puede servir}
 
 program validar;
  uses
     crt;
  var
    nomb : string[80];
    t : integer;
    valido : boolean;
  begin
 repeat
     clrscr;
     valido := true;
     write('   Entre Nombre y Apellido : ');
     readln(nomb);
     for t := 1 to length(nomb) do
     if ord(nomb[t]) in[32,65..90,97..122,164,165] then
     begin
     end
   else
      valido := false;
  if valido = false then
  begin
   writeln('**** Solo Letras y Espacios Pulse [Enter]');
   readln;
  end;
 until (valido = true) and (t = Length(nomb));
 clrscr;
 writeln('   Usted a Entrado : ',nomb,'   Pulse [Enter]');
 readln;
 end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar
sin imagen de perfil

AYUDA VALIDAR SOLO LETRAS O TEXTO EN PASCAL

Publicado por ELIAS (45 intervenciones) el 23/11/2012 17:38:52
Estupendo!!! sencillo y preciso, MUCHAS GRACIAS, tu Ayuda es invaluable, mi reconocimiento a tu labor!!! ,
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar