Sign in Join
FPDoc Onlineexperiment

TInt64List class

In unit IntegerList

Implements a specialization of TFPGList for Int64 data types.

Declaration

pascal
TInt64List = class()

Description

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

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

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

  • Add
  • IndexOf
  • Insert
  • Extract
  • Remove
  • Sort
  • AddList
  • Assign
  • First
  • Last
  • Items
  • List

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

Example:

// using TInt64List properties and methods
// var
//    AInt64List: TInt64List;
//    AIndex, ACount: Integer;
//    AMax, AValue: Int64;
AInt64List := TInt64List.Create;
ACount := 25;
AMax := High(Int64);

for AIndex := 1 to ACount do
  AInt64List.Add(Random(AMax));

AInt64List.Insert(4, 42);
AInt64List.Sort;
ACount := AInt64List.Count;
AIndex := AInt64List.IndexOf(AInt64List.Last);
AValue := AInt64List.Last;
AInt64List.Last := AValue - 1;
AValue := AInt64List.Extract(AInt64List.First);
AIndex := AInt64List.Remove(42);
AInt64List.Clear;
AInt64List.Free;

See also

Methods

SortpublicSorts the Int64 values stored in the list.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.