Ver Mensaje Individual
  #7  
Antiguo 17-11-2011
Avatar de oscarac
[oscarac] oscarac is offline
Miembro Premium
 
Registrado: sep 2006
Ubicación: Lima - Perú
Posts: 2.010
Reputación: 20
oscarac Va por buen camino
bueno quiza ya fue respondida la pregunta....
pero aqui les envio lo que yo hago

Código Delphi [-]
 
function Llenar(strValue: String; intNewWidth: Integer): String;
var intOldWidth, I: Integer;
begin
  try
    strValue := Trim (StrValue);
    if strValue = '' then
      strValue := '0';
    if StrToInt(strValue) < 0 then
      strValue := '0';
  except
    on EConvertError do strValue := '0';
  end;
  intOldWidth := Length(strValue);
  if intOldWidth < intNewWidth then
    for I := 1 to intNewWidth - intOldWidth do
      strValue := '0' + strValue;
  Result := strValue;
end;


para llamarlo

Código Delphi [-]
 
  edtNumIngreso.Text := Llenar(edtNumIngreso.Text, 11);
__________________
Dulce Regalo que Satanas manda para mi.....
Responder Con Cita