Ver Mensaje Individual
  #3  
Antiguo 14-06-2005
Avatar de asegurpe
asegurpe asegurpe is offline
No confirmado
 
Registrado: abr 2004
Ubicación: Barcelona
Posts: 16
Reputación: 0
asegurpe Va por buen camino
Posible solución

Hola,

Yo utilizo estas tres funciones para insertar espacios en un texto

Código:
 
{Espacios por la derecha}
function Padr(cString:string;nLen:integer):string;
begin
if (Length(cString) <> nLen) then
   if Length(cString) > nLen then
	  Result:= Copy(cString,1,nLen)
   else
	  Result:=cString+space(nLen-Length(cString))
 else
	 Result:= cString;
end;
 
 
{Espacios por la izquierda}
function Padl(cString:string;nLen:integer):string;
begin
if (Length(cString) <> nLen) then
   if Length(cString) > nLen then
	  Result:= Copy(cString,1,nLen)
   else
	  Result:=space(nLen-Length(cString)) + cString
 else
	 Result:= cString;
end;
 
{Generador de espacios}
function Space(nLen:integer):string;
begin
	 result:=replicate(' ',nLen);
end;

Saludos
Responder Con Cita