(Delphi ActiveX) Load StringTable from a StringBuilder
Demonstrates how to load a StringTable from the text contained in a Chilkat StringBuilder object.
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;
...
procedure TForm1.Button1Click(Sender: TObject);
var
strTab: TChilkatStringTable;
sb: TChilkatStringBuilder;
success: Integer;
i: Integer;
numStrings: Integer;
begin
strTab := TChilkatStringTable.Create(Self);
sb := TChilkatStringBuilder.Create(Self);
sb.Append('This is line 1' + #13#10);
sb.Append('An empty line follows...' + #13#10);
sb.Append(#13#10);
sb.Append('This is line 4' + #13#10);
strTab.AppendFromSb(sb.ControlInterface);
i := 0;
numStrings := strTab.Count;
while i < numStrings do
begin
Memo1.Lines.Add(IntToStr(i) + ': ' + strTab.StringAt(i));
i := i + 1;
end;
end;
|