On 06/2/11 1:55, Mark Morgan Lloyd wrote:
Given one or more lines of text which are known at compilation time, and
without the requirement to internationalize (these are, by RFC, US
ASCII), what is the best way to get them into a TStringList?

Perhaps there are better ways than the straightforward way?

const StringsToUse: string = 'Line 1'+LineEnding+
                             'Line 2'+LineEnding+
                             // + ...
                             'Line n';

var  FPreInitialisedSList: TStringList;

begin
  FPreInitialisedSList := TStringList.Create;
  FPreInitialisedSList.SetText(PChar(StringsToUse));

  // ...

  FPreInitialisedSList.Free;

H

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to