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.
| Parameter | Type | Description |
|---|---|---|
A, B | Integer | Integer 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.
| Parameter | Type | Description |
|---|---|---|
A, B | TFixed | Fixed-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.