Sven Barth kirjoitti sunnuntai 06 helmikuu 2011 16:24:49: > FPreInitialisedSList.Text := StringsToUse; > > Note: You can also define StringsToUse as a typeless constant, e.g.: > > const StringsToUse = 'Line 1' + LineEnding + > 'Line 2' + LineEnding + > // + ... > 'Line n';
The most obvious solution is the best this time. List.Add('Line 1'); List.Add('Line 2'); ... List.Add('Line n'); Setting the Text property (or calling the SetText method) parses the text and splits it by NewLine chars. It makes no sense because you have concatenated the strings with NewLines. Method Add does not need to parse anything. None of these solutions is "preinitialised", compile time solution. You can only initialize a const static arrays at compile time. Juha _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal