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, 'Ñ']; 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);
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.