Download CIMPLICITY BCE Language Reference Manual
Transcript
ebError (constant)
Description
Number representing the type of an error variant.
Comments
This constant is equal to 10.
Example
This example checks to see whether a variable is an error.
Function Div(ByVal a As Variant,ByVal b As Variant) As Variant
On Error Resume Next
Div = a / b
If Err <> 0 Then Div = CVErr(Err)
End Function
Sub Main()
a = InputBox("Please enter 1st number","Division Sample")
b = InputBox("Please enter 2nd number","Division Sample")
res = Div(a,b)
If VarType(res) = ebError Then
res = CStr(res)
res = Error(Mid(res,7,Len(res)))
MsgBox "'" & res & "' occurred"
Else
MsgBox "The result of the division is: " & res
End If
End Sub
See Also
VarType (function); Variant (data type).
ebDate (constant)
Description
Number representing the type of a Date variant.
Comments
This constant is equal to 7.
Example
Sub Main()
Dim MyVariant as Variant
If VarType(MyVariant) = ebDate Then
MsgBox "This variable is a Date type!"
Else
MsgBox "This variable is not a Date type!"
End If
End Sub
See Also
VarType (function); Variant (data type).
GFK-1283G
E
7-5