[Overview][Constants][Types][Classes][Procedures and functions][Variables] |
Move a string from one place in the list to another.
Source position: classesh.inc line 499
public procedure TStrings.Move( |
CurIndex: Integer; |
NewIndex: Integer |
); virtual; |
Movemoves the string at position CurIndexso it has position NewIndexafter the move operation. The object associated to the string is also moved. CurIndexand NewIndexshould be in the range of 0to Count-1.
Remark: | NewIndexis notthe position in the stringlist before the move operation starts. The move operation
This may not lead to the desired result if NewIndexis bigger than CurIndex. Consider the following example: With MyStrings do begin Clear; Add('String 0'); Add('String 1'); Add('String 2'); Add('String 3'); Add('String 4'); Move(1,3); end; After the Moveoperation has completed, 'String 1' will be between 'String 3' and 'String 4'. |
If either CurIndexor NewIndexis outside the allowed range, an EStringListErroris raised.
|
Exchanges two strings in the list. |