System.Classes.TStrings.Move

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Move(CurIndex, NewIndex: Integer); virtual;

C++

virtual void __fastcall Move(int CurIndex, int NewIndex);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Classes.pas
System.Classes.hpp
System.Classes TStrings

Description

Changes the position of a string in the list.

Use Move to move the string at position CurIndex so that it occupies the position NewIndex. The positions are specified as 0-based indexes. For example, the following lines of code move the string in the first position to the last position:

For Delphi:

MyStringsObject.Move(0, MyStringsObject.Count - 1);

For C++:

MyStringsObject->Move(0, MyStringsObject->Count - 1);

If the string has an associated object, the object remains associated with the string in its new position.

See Also

Code Examples