LCCurrency の Compare メソッド

このメソッドは、2 つの Currency 値を比較し、その関係を返します。

定義位置

LCCurrency

構文

Result = thisCurrency.Compare(baseCurrency)

パラメータ

パラメータ

説明

baseCurrency

LCCurrency。thisCurrency を比較する基準となる Currency 値。

戻り値

説明

結果

Long。比較の結果 (以下のいずれか)。

 

Result > 0 (正): thisCurrency は baseCurrency より大きい。

 

Result < 0 (負): thisCurrency は baseCurrency より小さい。

 

Result = 0: thisCurrency は baseCurrency と等しい。

Option Public
Uselsx "*lsxlc"  
Sub Initialize
  Dim num1 As New LCCurrency //For LEI
  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

出力例

The first number is greater than the second.