Description |
Compares ValueA with ValueB value.
Returns one of the following values :
ValueA < ValueB | Gives <0 |
ValueA = ValueB | Gives 0 |
ValueA > ValueB | Gives >0 |
The exact value is not guaranteed.
|
| Notes | Static methods are not methods of an object - they are simply class functions or procedures available at any time.
|
|
Microsoft MSDN Links |
System
System.Decimal
|
|
|
A simple example |
program Project1;
{$APPTYPE CONSOLE}
var
valueA, valueB : Decimal;
result : Integer;
begin
valueA := 23;
valueB := 57;
result := System.Decimal.Compare(valueA, valueB);
Console.WriteLine('valueA compared to valueB = {0}', result.ToString);
result := System.Decimal.Compare(valueB, valueB);
Console.WriteLine('valueB compared to valueB = {0}', result.ToString);
result := System.Decimal.Compare(valueB, valueA);
Console.WriteLine('valueB compared to valueA = {0}', result.ToString);
Console.ReadLine;
end.
| Show full unit code | valueA compared to valueB = -1
valueB compared to valueB = 0
valueB compared to valueA = 1
|
|
|
|