Take Care When you Declare

Take Care When you Declare

This is a common error among C programmers who have recently switched to VB. This code would result in A and B as Variant variables and only C as an Integer variable:

 Dim a, b, c As Integer

Here’s the proper way to declare these variables:

 Dim a As Integer, b As Integer, c As Integer


 Dim a%, b%, c%


Share the Post: