Ver Mensaje Individual
  #11  
Antiguo 19-04-2012
BrunoBsso BrunoBsso is offline
Miembro
 
Registrado: nov 2009
Ubicación: Berisso, Buenos Aires, Argentina
Posts: 239
Reputación: 15
BrunoBsso Va por buen camino
Conseguí acceso a un compilador y vi la asquerosidad de código que escribí
En fin, acá tenés algo que te puede servir.
Código Delphi [-]
function OnlyNumsCaps(Str: String): Boolean;
const
  VALID = [#48 .. #57, #65 .. #90, 'Ñ']; //'0' .. '9' + 'A' .. 'Z' + 'Ñ'
var
  I: Integer;
begin
  Result := True;
  for I := 1 to Length(Str) do
  begin
    if not(Str[i] IN VALID) then
    begin
      Result := False;
      Exit;
    end;
  end;
end;

procedure ParseStr(MyStr: String);
//MyStr := 'abc DE32F ghi JKL MNÑAS oPq RS1 2TFFU xzc2 hn2d AJwd7J kekgnwo'
var
  SList: TStringList;
  I: Integer;
begin
  SList := TStringList.Create;
  SList.DelimitedText := MyStr;
  SList.Delimiter := ' ';
  for I := 0 to SList.Count-1 do
    if (OnlyNumsCaps(SList[i])) and (Length(SList[i]) = 5) then
      ShowMessage(SList[i]);
  SList.Free;
end;

Saludos.
Responder Con Cita