JCL Help:SwapOrd@Byte@Byte

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Swaps two integer-typed variables.


Pascal

 procedure SwapOrd(var X: Integer; var Y: Integer);
procedure SwapOrd(var I: Byte; var J: Byte); overload;
procedure SwapOrd(var I: Shortint; var J: Shortint); overload;
procedure SwapOrd(var I: Smallint; var J: Smallint); overload;
procedure SwapOrd(var I: Word; var J: Word); overload;
procedure SwapOrd(var I: Cardinal; var J: Cardinal); overload;
procedure SwapOrd(var I: Int64; var J: Int64); overload;


Parameters

Parameters Description
var I: Byte First of the two variables to swap.
var J: Byte Second of the two variables to swap.


Return Value

At the end of this routine I will contain the original value of J and J will contain the original value of I.


Description

The Swap function swaps the two supplied arguments. When the function returns I has the value of J and J has the value of I. This function exist in 7 forms, one for each Integer type. A function to swap floating point values exists as well in the JclMath unit, see SwapFloat.


About

Unit

JclLogic


Donator

Marcel van Brakel


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page