Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32_LowLevel🞂TestSwapProcedure

TestSwap

Exchanges two values if the second value is strictly smaller than the first.

Declarations ​

pascal
procedure TestSwap(var A, B: Integer); overload;
procedure TestSwap(var A, B: TFixed); overload;
Overload Details

Overload 1 ​

pascal
procedure TestSwap(var A, B: Integer); overload;

Ensures A <= B for Integer values by swapping if B < A.

ParameterTypeDescription
A, BIntegerInteger variables to evaluate and conditionally swap.

Overload 2 ​

pascal
procedure TestSwap(var A, B: TFixed); overload;

Ensures A <= B for TFixed values by swapping if B < A.

ParameterTypeDescription
A, BTFixedFixed-point variables to evaluate and conditionally swap.

Description ​

TestSwap checks whether B < A. If B is smaller than A, the two variables are swapped so that upon return, A is guaranteed to be less than or equal to B.

See also ​