[Lazarus] Saving an array to a string

Michael Thompson mike.cornflake at gmail.com
Tue Jul 1 17:11:31 CEST 2014


I'm lazy, I'd do it via a TStringList :-)

MyStringList := TStringList.Create;
MyStringList.Text := MyStringField.AsString;

SetLength(MyArray, MyStringlist.Count);
For i := 0 To MyStringList.Count-1 Do
  MyArray[i] := MyStringList[i];

MyStringList.Free;

In fact, I'd use a TStringList at both ends of the code, and not use an
Array Of String at all...  I like it when other code does my work for me :-)

Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140701/fc1fb5dc/attachment-0003.html>


More information about the Lazarus mailing list