Access Byref Argument Type Mismatch Code Example


Example: ByRef argument type mismatch

' If you don't specify a type for a variable, the variable receives the default  ' type, Variant. This isn't always obvious. For example, the following code   ' declares two variables, the first, "MyVar", is a Variant; the second,  ' "AnotherVar", is an Integer. Sub main()       Dim MyVar, AnotherVar As Integer ' MyVar->Variant, AnotherVar->Integer     'Dim MyVar As Integer, AnotherVar As Integer ' Both are declared integers     MyVar = 3.1415      Call SomeSub((MyVar))  End Sub Sub SomeSub (MyNum As Integer)      MyNum = MyNum + MyNum  End Sub

Comments

Popular posts from this blog

530 Valid Hostname Is Expected When Setting Up IIS 10 For Multiple Sites

C Perror Example

Converting A String To Int In Groovy