看看下面代码怎么样,呵呵 if not pr_active then Exit; s_Str := Trim(ADOQuery1.FieldByName('query_reply').AsString); num := 0; if Length(s_Str) > 95 then begin s_i := Length(s_Str) div 95; for i := 1 to s_i do begin num := i*95+i-1; if (ByteType(s_Str,num) = mbTrailByte) //蛮竊材竊 then insert(' ',s_Str,num-1); if (ByteType(s_Str,num) = mbSinglebyte) //虫竊 then insert(' ',s_Str,num); if (ByteType(s_Str,num) = mbLeadByte) // 蛮竊材竊 then insert(' ',s_Str,num); end; // showmessage(s_Str); end else Exit; if s_Str <> Trim(ADOQuery1.FieldByName('query_reply').AsString) then begin ADOQuery1.Edit; ADOQuery1.FieldByName('query_reply').AsString := s_Str; // ADOQuery1.Post; end;
s_Str := Trim(ADOQuery1.FieldByName('query_reply').AsString); num := 0;
if Length(s_Str) > 95 then
begin
s_i := Length(s_Str) div 95; for i := 1 to s_i do
begin
num := i*95+i-1;
if (ByteType(s_Str,num) = mbTrailByte) //蛮竊材竊
then insert(' ',s_Str,num-1); if (ByteType(s_Str,num) = mbSinglebyte) //虫竊
then insert(' ',s_Str,num); if (ByteType(s_Str,num) = mbLeadByte) // 蛮竊材竊
then insert(' ',s_Str,num);
end;
// showmessage(s_Str);
end else Exit; if s_Str <> Trim(ADOQuery1.FieldByName('query_reply').AsString) then
begin
ADOQuery1.Edit;
ADOQuery1.FieldByName('query_reply').AsString := s_Str;
// ADOQuery1.Post;
end;
可以先在窗体中放一个MEMO
然后把内容读到MEMO里
然后在把MEMO里的内容放到一个变量里,记得每读一行都要加一个#13
然后把这个变量传到报表里
没了!
要不然memo里面不还是一行。