Compare Method for LCCurrency

This method compares two currency values and returns the relationship.

Defined In

LCCurrency

Syntax

Result = thisCurrency.Compare(baseCurrency)

Parameters

Parameter

Description

baseCurrency

LCCurrency. The base currency value to which to compare thisCurrency.

Return Value

Value

Description

Result

Long. Result of the comparison:

Result > 0 (positive): thisCurrency is greater than baseCurrency.

Result < 0 (negative): thisCurrency is less than baseCurrency.

Result = 0: thisCurrency is equal to baseCurrency

Example

Option Public
Uselsx "*lsxlc"  
Sub Initialize
  Dim num1 As New LCCurrency //For HEI
  Dim num2 As New LCCurrency
  num1.Value = 123.456789
  num2.Value = 123
  If (num1.Compare (num2) = 0) Then
    Print "The first number is the same as the second."
  Elseif (num1.Compare (num2) > 0) Then
    Print "The first number is greater than the second."
  Else
    Print "The first number is less than the second."
  End If
End Sub

Example Output

The first number is greater than the second.