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

TCardinalList

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

Implements a specialization of TFPGList for Cardinal data types.

Declaration

Source position: integerlist.pas line 35

type TCardinalList = class()

public

  procedure Sort; overload;

  

Sorts the Word values stored in the list.

end;

Inheritance

TCardinalList

  

Implements a specialization of TFPGList for Cardinal data types.

|

?

TObject

Description

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

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

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

Example:

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

Another example using TCardinalList can be found in the components/jcf2/ReadWrite/diffmerge.pas unit.

See also

TByteList

  

Implements a specialization of TFPGList for the Byte data type.

TWordList

  

Implements a specialization of TFPGList for the Word data type.

TIntegerList

  

Implements a specialization of TFPGList for Integer data types.

TInt64List

  

Implements a specialization of TFPGList for Int64 data types.

TCardinalList.Sort

  

Sorts the Word values stored in the list.

TFPGList.Sort

TFPGList

TFPGListEnumerator


Version 4.0 Generated 2025-05-03 Home