'/**
' * Copyright mpl by ERB software
' * http://wiki.yaslaw.info/dokuwiki/doku.php/vba/functions/index#isbyte
' *
' * Prüft on ein Value ein Byte-Wert ist
' * @param Variant Zu prüfender Wert
' * @return Boolean
' */
Public Function isByte(ByVal iExpression As Variant) As Boolean
If Not IsNumeric(iExpression) Then Exit Function
If iExpression < 0 Or 255 < iExpression Then Exit Function
isByte = (CByte(iExpression) = iExpression)
End Function
'/**
' * Copyright mpl by ERB software
' * http://wiki.yaslaw.info/dokuwiki/doku.php/vba/functions/index#isinteger
' *
' * Prüft on ein Value ein Integer-Wert ist
' * @param Variant Zu prüfender Wert
' * @param Boolean Angabe, ob Byte auch als Integer gelten (Byte: 0 bis 255)
' * @return Boolean
' */
Public Function isInteger(ByVal iExpression As Variant, Optional ByVal iWithByte As Boolean = False) As Boolean
If Not IsNumeric(iExpression) Then Exit Function
If iExpression < -32768 Or 32767 < iExpression Then Exit Function
isInteger = (CInt(iExpression) = iExpression)
If Not iWithByte And isInteger Then isInteger = Not isByte(iExpression)
End Function
'/**
' * Copyright mpl by ERB software
' * http://wiki.yaslaw.info/dokuwiki/doku.php/vba/functions/index#islong
' *
' * Prüft on ein Value ein Long-Wert ist
' * @param Variant Zu prüfender Wert
' * @param Boolean Angabe, ob Integer/Byte auch als Long gelten (Integer: -32768 bis 32767)
' * @return Boolean
' */
Public Function isLong(ByVal iExpression As Variant, Optional ByVal iWithInteger As Boolean = False) As Boolean
If Not IsNumeric(iExpression) Then Exit Function
If iExpression < -2147483648# Or 2147483647 < iExpression Then Exit Function
isLong = (CLng(iExpression) = iExpression)
If Not iWithInteger And isLong Then isLong = Not isInteger(iExpression)
End Function
'/**
' * Copyright mpl by ERB software
' * http://wiki.yaslaw.info/dokuwiki/doku.php/vba/functions/index#isdouble
' *
' * Prüft on ein Value ein Double-Wert ist
' * @param Variant Zu prüfender Wert
' * @param Boolean Flag ob ein Integer/Long als Double akzeptiert werden soll
' * @return Boolean
' */
Public Function isDouble(ByVal iExpression As Variant, Optional ByVal iWithIntLng As Boolean = False) As Boolean
If Not IsNumeric(iExpression) Then Exit Function
isDouble = (CDbl(iExpression) = iExpression)
If Not iWithIntLng And isDouble Then isDouble = Not isLong(iExpression, True)
End Function