MakeInteger |
| 機能 |
上位・下位バイトを与えて整数値(Integer)を取得する |
| 宣言文 |
Function MakeInteger(ByVal UpperByte As Byte, ByVal LowerByte As Byte) As Integer
'上位・下位バイトを与えて整数値(Integer)を取得する
Dim IntValue As Integer
'上位バイトが&H7Fより大きいとき、得られる整数が符号あり整数の範囲を超えるので
'&H10000を引くことで符号あり整数の範囲に戻す
If UppperByte > &H7F Then
IntValue = (LowerByte + (UpperByte * &H100)) - &H10000
Else
IntValue = LowerByte + (UpperByte * &H100)
End If
MakeInteger = IntValue
End Function |
| 引数 |
| UpperByte |
上位バイト |
| LowerByte |
下位バイト |
| 戻り値 |
作成された整数値 |
| 備考 |
Visual C++のMakeWord()関数と同じ |