Hola Gastón.
No hay problema, como dijiste 'programa externo' pensé en dos ejecutables.
Mirá yo haría así :
Agregaría una variable privada más (FLinea) que me sirva para indizar la línea actual del memo y
aprovecharía la evaluación de condición anterior para incrementar la misma.
Código Delphi
[-]
unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Label1: TLabel;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
FCaption: string;
FLinea: Integer;
public
end;
var
Form1: TForm1;
implementation{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Memo1.Lines.LoadFromFile('C:\PRUEBA.TXT'); FLinea:= 0;
FCaption:= Memo1.Lines[FLinea];
Caption:= FCaption;
Timer1.Interval := 1000 div 5;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
txt: string;
begin
txt:= Caption;
Caption:= Copy(txt, Length(txt), 1) + Copy(txt, 1, Length(txt) -1);
if FCaption = Caption then
begin
Inc(FLinea);
Caption:= Memo1.Lines[FLinea];
FCaption:= Caption;
end;
end;
En cuanto la decteccíon de Ctrl+C para copiar y otra convinación para pegar lo podés capturar en el evento OnKeyDown del Memo o el Form. ( lamento andar con poco tiempo ahora para implementartelo, pero si luego hago un rato intento..)
Espero haberte entendido.
Saludos.
