[Overview][Classes][Index] Reference for unit 'IntegerList' (#lazutils)

TWordList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements a specialization of TFPGList for the Word data type.

Declaration

Source position: integerlist.pas line 30

type TWordList = class()

public

  procedure Sort; overload;

  

Sorts the Word values stored in the list.

end;

Inheritance

TWordList

  

Implements a specialization of TFPGList for the Word data type.

|

?

TObject

Description

TWordList provides an overloaded Sort method to ensure that values in the list are handled using a compare function that operates on Word values. Internally, it provides a TFPGListEnumerator which is specialized for the Word type used in the implementation.

Use the properties and methods defined in the ancestor class to perform common operations for Word values, including:

Items is the default property, and allows access to values by ordinal position or by using an enumerator to traverse the Word values in List.

// using TWordList properties and methods
// var
//    AWordList: TWordList;
//    AIndex, ACount: Integer;
//    AMax, AValue: Word;
AWordList := TWordList.Create;
AMax := High(Word);
AWordList.Add(Random(AMax));
AWordList.Add(Random(AMax));
AWordList.Add(Random(AMax));
AWordList.Add(Random(AMax));
AWordList.Insert(2, 42);
AWordList.Sort;
ACount := AWordList.Count;
AIndex := AWordList.IndexOf(AWordList.Last);
AValue := AWordList.Last;
AWordList.Last := AValue - 1;
AValue := AWordList.Extract(AInt64List.First);
AIndex := AWordList.Remove(42);
AWordList.Clear;
AWordList.Free;

See also

TByteList

  

Implements a specialization of TFPGList for the Byte data type.

TCardinalList

  

Implements a specialization of TFPGList for Cardinal data types.

TIntegerList

  

Implements a specialization of TFPGList for Integer data types.

TInt64List

  

Implements a specialization of TFPGList for Int64 data types.

TFPGList

TFPGListEnumerator


Version 4.0 Generated 2025-05-03 Home