Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Impresión
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 23-07-2004
Avatar de delphi.com.ar
delphi.com.ar delphi.com.ar is offline
Federico Firenze
 
Registrado: may 2003
Ubicación: Buenos Aires, Argentina *
Posts: 5.964
Poder: 29
delphi.com.ar Va camino a la fama
Si puedes hacerlo, recuerda que cuando imprimes directamente en el puerto, es como sie estuvieras armando un archivo de texto, y puedes utilizar cualquier función de strings para hacerlo. Podrías armarte algunas funciones del tipo LPad o RPad y definirle un ancho estricto a cada columna.

Yo tengo armadas estas funciones sobrecargadas:
Código Delphi [-]
function LPad(Value: string; Key: Char = ' '; ALenght: Integer = 0): string;
var
  iLen: Integer;
begin
  iLen := Length(Value);

  if (iLen > ALenght) then
    Result := Copy(Value, 1, ALenght)
  else
    Result := StringOfChar(Key, ALenght-iLen) + Value;
end;

function LPad(Value: Integer; Key: Char = '0'; ALenght: Integer = 0): string;
begin
  Result := LPad(IntToStr(Value), Key, ALenght);
end;

function RPad(Value: string; Key: Char = ' '; ALenght: Integer = 0): string;
var
  iLen: integer;
begin
  iLen  := Length(Value);

  if (iLen > ALenght) then
    Result := Copy(Value, 1, ALenght)
  else
     Result := Value + StringOfChar(Key, ALenght-iLen);
end;

function RPad(Value: integer; Key: Char = '0'; ALenght: Integer = 0): string;
begin
  Result := RPad(IntToStr(Value), Key, ALenght);
end;

Saludos!
__________________
delphi.com.ar

Dedique el tiempo suficiente para formular su pregunta si pretende que alguien dedique su tiempo en contestarla.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 00:27:29.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi