Field-Map Scripting

4.5.1.9 Assign

Assign procedure


Prototype:

procedure Assign(Source :TStringListWrapper);

Description:

Assign procedure replaces the current StringList with the contents of another StringList.

Syntax:

StringList.Assign(Source);


Part

Description


StringList

A reference to an instance of a TStringListWrapper


Source

A StringList which replaces current StringList. A reference to an instance of a TStringListWrapper

Return value:

none



Example:


var

 strList1, strList2 : TStringListWrapper;

 t : string;


begin

 strList1 := CreateStringList;

 strList2 := CreateStringList;


 strList1.BeginUpdate;

 strList1.Add('Picea');

 strList1.Add('Fagus');

 strList1.Add('Pinus');

 strList1.EndUpdate;


 strList2.Add('Trees:');   // this will be it replaced


 strList2.Assign(strList1);


 t:= strList2.Text;


 ShowMsg(t);


 strList1.Free;

 strList2.Free;

end.



Output in Field-Map Data Collector:



See also:

Free; Duplicates; Sorted; CaseSensitive; BeginUpdate; EndUpdate; Add; AddStrings; Assign; Clear; Delete; Count; Exchange; Move; Find; IndexOf; Insert; Sort; LoadFromFile; SaveToFile; Strings; Text; Delimiter; DelimitedText; NameValueSeparator; IndexOfName; Name; Value; AsVarArray