Basic utility functions and procedures.
rjBase
does not use any additional units.
None.
function BSwap(const Value: Integer): Integer; overload; |
Reverses the byte order of a given integer number. For example, 001.002.003.004 returns 004.003.002.001.
function BSwap(const Value: Cardinal): Cardinal; overload; |
Reverses the byte order of a given cardinal number. For example, 001.002.003.004 returns 004.003.002.001.
function CardinalToHex(const Value, Digits: Cardinal): AnsiString; |
CardinalToHex
returns the hex representation of a Cardinal.
The CardinalToHex
function converts a number into a string containing the number's hexadecimal (base 16) representation. Value
is the number to convert. Digits
indicates the minimum number of hexadecimal digits to return.
procedure FreeAndNil(var Obj); |
Use FreeAndNil
to ensure that a variable is nil after you free the object it references. Pass any variable that represents an object as the Obj parameter.
Warning: Do not pass a value for Obj if it is not an instance of TObject or one of its descendants.
function IntToStr(const i: Integer): AnsiString; |
This IntToStr
implementation is faster than the original Delphi IntToStr
function found in SysUtils.pas.
function LeftMostBit(const Value: Cardinal): Integer; |
Returns the index of the leftmost set bit in Value. Bits are indexed from right to left, starting with 0 and ending with 31. If no bit is set in Value, LeftMostBit
returns -1.
See also:
function Max(const a, b: Cardinal): Cardinal; overload; |
Max
returns the greater of two numeric values.
function Max(const a, b: Integer): Integer; overload; |
Max
returns the greater of two numeric values.
function Min(const a, b: Cardinal): Cardinal; overload; |
Min
returns the lesser of two numeric values.
function Min(const a, b: Integer): Integer; overload; |
Min
returns the lesser of two numeric values.
function RightMostBit(const Value: Cardinal): Integer; |
Returns the index of the rightmost set bit in Value. Bits are indexed from right to left, starting with 0 and ending with 31. If no bit is set in Value, RightMostBit
returns -1.
See also:
procedure ZeroMem(var X; const Count: Cardinal); |
Fills Count contiguous bytes with 0 (zero).
Warning: This function does not perform any range checking.
None.
None.
None.
Ralf Junker -- delphi@zeitungsjunge.de