我有这个德尔福功能:
function DevuelveResumenEventos(cnnBBDD : TADOConnection;sFecha,sHora,sCtrlPac : string) : TStream;
var
sTextoArmado : string;
stCarga : TStringStream;
begin
with TADOTable.Create(Application.MainForm) do
try
sTextoArmado := '';
Connection := cnnBBDD;
TableName := 'EAPC_EVENTOS';
Filter := 'EAPC_FECHA = '+sFecha+' and EAPC_HORA = '+sHora+' and EAPC_CTRL_PAC = '+sCtrlPac;
Filtered := True;
Open;
while not Eof do
begin
sTextoArmado := sTextoArmado + FormatDateTime('dd-mm-yyyy', FieldValues['EAPC_FECHA_EVENTO'])+
' '+MinutsToStr(FieldValues['EAPC_HORA_EVENTO'])+
' ('+Trim(FieldValues['EAPC_LOGIN_USER'])+
') - '+FieldByName('EAPC_EVENTO').AsString+CRLF+CRLF;
Next;
end;
**stCarga := TStringStream.Create(sTextoArmado);
with TRichEdit.Create(Application.MainForm) do
begin
Parent := Application.MainForm;
Text := sTextoArmado;
Lines.SaveToStream(stCarga);
Free;
end;
finally
Close;
Free;
end;
Result := stCarga;**
end;
目的是检索一系列 RTF 格式的文本,将它们与其他文本连接起来,并将它们返回到单个 TStringStream 中,以便在 TRichEdit 中以表单的形式显示。
如何跳过“使用即时 RichEdit”并将生成的文本作为 TStringStream 发送?