🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.misc
2 messages
2 total messages Started by pierre guinnard Fri, 06 Mar 1998 00:00
converting string stored in a file into Rich Text Edit
#594
Author: pierre guinnard
Date: Fri, 06 Mar 1998 00:00
24 lines
1693 bytes
Hello everybody,

I got a little problem while updating a software. The problem is :

In the original application, the data are stored in such a record :
              My_Data    =  Record
                                     LAW_FPos   :  String
[03];            LAW_NrFill  :  Integer;
                                     LAW_Text    :  Array [01..13] of
String [255];
                                     End;
And I should display those data in a box built with "TRichEdit". Those
string are concatenated together, with appropriate "Carriage Return" and
"Line Feed" characters inserted.

The only result I got is the display of the first 255 characters, and I
can't get the following characters.

How could I resolve this problem ?

Many thanks to everyone who help me...

My email : guinnard@iprolink.ch
Re: converting string stored in a file into Rich Text Edit
#595
Author: Cybercat
Date: Sat, 07 Mar 1998 00:00
46 lines
2383 bytes
On Fri, 06 Mar 1998 08:38:41 +0100, pierre guinnard
<guinnard@iprolink.ch> wrote:

>Hello everybody,
>
>I got a little problem while updating a software. The problem is :
>
>In the original application, the data are stored in such a record :
>              My_Data    =  Record
>                                     LAW_FPos   :  String
>[03];            LAW_NrFill  :  Integer;
>                                     LAW_Text    :  Array [01..13] of
>String [255];
>                                     End;
>And I should display those data in a box built with "TRichEdit". Those
>string are concatenated together, with appropriate "Carriage Return" and
>"Line Feed" characters inserted.
>
>The only result I got is the display of the first 255 characters, and I
>can't get the following characters.

I suspect that when you concatenate the various strings, you assign
the result to a String[255]. I do not know how you've set the compiler
directives, so I'd propose you use S: AnsiString (most of us simply
use String without a maximum length specifier, which serves as a "long
sting", that is one that might be much longer than 255 characters.

procedure TForm1.AddToRichEdit(TheData: My_Data);
var S,T: AnsiString;
begin
  S := '';
  for I := 1 to 15 do
    with TheData do
    begin
      case I of
        1: T := LAW_FPos;
        2: T := IntToStr(LAW_NrFill);
        else T := LAW_Text[I-2]
      end;
      S := Concat(S,T,^M,^J)
    end;
  RichEdit1.Text := S
end;

Should do the trick.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads