Unit Dbmutils

Classes

Functions

AbsoluteToPercent - function AbsoluteToPercent returns Fraction/FullSize as a percent

convert and round
Assert - procedure Assert if Condition is False, throws the given exception type with the given message attached to it.
AssertFMT - procedure AssertFMT if Condition is False, throws the given exception type with a message created from the Message and Args parameters
Maximum - function Maximum returns the maximum of the two numbers

use floating point arithmetic to implement conversion
Minimum - function Minimum returns the minimum of the two numbers
PercentToAbsolute - function PercentToAbsolute returns the given percentage of FullSize
SortStrings - procedure SortStrings sorts the given list using the SortFunc to order the elements

Types

TPercentRange
TSortStringsFunc

Constants

Variables


Functions


function AbsoluteToPercent(Fraction, FullSize: LongInt): TPercentRange;

function AbsoluteToPercent returns Fraction/FullSize as a percent

convert and round


procedure Assert(Condition: Boolean; Message: String; ExceptionType: ExceptClass);

procedure Assert if Condition is False, throws the given exception type with the given message attached to it.

procedure AssertFMT(Condition: Boolean; Message: String; const Args: Array of Const; ExceptionType: ExceptClass);

procedure AssertFMT if Condition is False, throws the given exception type with a message created from the Message and Args parameters

function Maximum(A, B: LongInt): LongInt;

function Maximum returns the maximum of the two numbers

use floating point arithmetic to implement conversion


function Minimum(A, B: LongInt): LongInt;

function Minimum returns the minimum of the two numbers

function PercentToAbsolute(Percentage: Integer; FullSize: LongInt): LongInt;

function PercentToAbsolute returns the given percentage of FullSize

procedure SortStrings(List: TStrings; SortFunc: TSortStringsFunc);

procedure SortStrings sorts the given list using the SortFunc to order the elements

Types


TPercentRange =     0 .. 100
range for percentage values
TSortStringsFunc = function (List: TStrings; Index1, Index2: Integer): Integer
callback function type for sorting strings should return > 0 if the element at Index1 > element at Index2 = 0 if they are equal < 0 if the element at Index1 < element at Index2

Constants


Variables