Integer Arrays

A file that stores type functions to manipulate TIntegerArrays.

The source for this file can be found here.

TIntegerArray.addIndex

procedure TIntegerArray.addIndex(const int : Integer; const index : Integer);

Used to add a value to a TIntegerArray at a chosen index.

Note

  • by Zyt3x

Example:

TIA.addIndex(1337, 0);

TIntegerArray.deleteIndex

procedure TIntegerArray.deleteIndex(const index : Integer);

Used to delete a value of a TIntegerArray at a chosen index.

Note

  • by Zyt3x

Example:

TIA.deleteIndex(0);

TIntegerArray.append

procedure TIntegerArray.append(const int : Integer);

Used to append a value to a TIntegerArray.

Note

  • by Zyt3x

Example:

TIA.append(1337);

TIntegerArray.combine

procedure TIntegerArray.combine(const arr : TIntegerArray);

Used to combine two TIntegerArray variables.

Note

  • by Zyt3x

Example:

TIA.combine(TIA2);

TIntegerArray.returnInArray

function TIntegerArray.returnInArray(const int : Integer) : Integer;

Returns the index of where the value was found in a TIntegerArray. Returns -1 if not found.

Note

  • by Zyt3x

Example:

writeLn(TIA.returnInArray(1337));

TIntegerArray.isInArray

function TIntegerArray.isInArray(const int : Integer) : Boolean;

Returns True if the value is present in the TIntegerArray.

Note

  • by Zyt3x

Example:

writeLn(TIA.returnInArray(1337));

TIntegerArray.include

function TIntegerArray.include(const arr : TIntegerArray) : TIntegerArray;

Returns a TIntegerArray which contains values that are present in both arrays.

Note

  • by Zyt3x

Example:

TIA := TIA2.include(TIA);

TIntegerArray.exclude

function TIntegerArray.exclude(const arr : TIntegerArray) : TIntegerArray;

Returns a TIntegerArray which contains values that are not present in both arrays.

Note

  • by Zyt3x

Example:

TIA := TIA2.exclude(TIA);

TIntegerArray.swap

procedure TIntegerArray.swap(var arr : TIntegerArray);

Used to swap two TIntegerArray variables.

Note

  • by Zyt3x

Example:

TIA.swap(TIA2);

TIntegerArray.clearEquals

procedure TIntegerArray.clearEquals();

Used to clear duplicates in a TIntegerArray.

Note

  • by Zyt3x

Example:

TIA.clearEquals();

TIntegerArray.invert

procedure TIntegerArray.invert();

Used to invert the TIntegerArray.

Note

  • by Zyt3x

Example:

TIA.invert();

TIntegerArray.sum

function TIntegerArray.sum() : Integer;

Returns the sum of all values in a TIntegerArray.

Note

  • by Zyt3x

Example:

writeLn(toStr(TIA.sum()));

TIntegerArray.sum64

function TIntegerArray.sum64() : Integer;

Returns the sum of all values in a TIntegerArray. Returns the value in a Int64 variable.

Note

  • by Zyt3x

Used for large numbers.

Example:

writeLn(toStr(TIA.sum64()));

TIntegerArray.average

function TIntegerArray.average() : Integer;

Returns the average of all values in a TIntegerArray.

Note

  • by Zyt3x

Example:

writeLn(toStr(TIA.average()));

TIntegerArray.sortQuick

procedure TIntegerArray.quickSort();

Used to QuickSort the TIntegerArray.

Note

  • by Zyt3x

Example:

TIA.sortQuick();

TIntegerArray.toExtendedArray

function TIntegerArray.toExtendedArray() : TExtendedArray;

Turns a TIntegerArray into a TExtendedArray.

Note

  • by Zyt3x

Example:

TEA := TIA.toExtended;

TIntegerArray.getMostCommon

function TIntegerArray.getMostCommon(): LongInt;

Returns the most common number in the array, useful for finding the most common color in a TPointArray.

Note

  • by Dgby714

Example:

mostCol := getColors(tpa).getMostCommon();

TIntegerArray.shuffle

procedure TIntegerArray.shuffle

Shuffles (randomly sorts) all of the elements in the array.

Note

  • by The Mayor

Example:

TIA.shuffle();