3 Imports Microsoft.VisualBasic
\r
7 Sub f1(ByRef a As Object)
\r
10 Sub f2(ByVal array() As Object, ByVal index As Integer, ByVal count As Integer, ByVal value As Object)
\r
12 For i = index To (index + count) - 1
\r
19 On Error GoTo ErrorHandler
\r
22 Dim b() As Object = New String(10) {}
\r
24 f1(b(1)) ' ArrayTypeMismatchException
\r
26 Dim str(100) As String
\r
27 f2(str, 0, 101, "Undefined")
\r
28 f2(str, 0, 10, Nothing)
\r
29 f2(str, 91, 10, 0) ' ArrayTypeMismatchException
\r
33 If Err.Number <> 5 Then ' System.ArrayTypeMismatchException
\r
34 Throw New Exception("#CA1 - Conversion Statement failed")
\r