'As' Clause Error...

lidds

Well-known member
Joined
Oct 19, 2004
Messages
122
Programming Experience
Beginner
I have purchased a 3rd party control, and in the manual it has told me to use the following code:

VB.NET:
Const AP_PROP_OUTDIR = 1

However this code is giving a warning in Visual Studio of:

Variable declaration without 'As' clause; type of Object assumed

I assume that this is VB code and not VB.Net code, however I am uncertain how to resolve this error.

Sorry for something that is probably a simple fix.

Thanks in advance

Simon
 
It is not an error, it is a warning. An error would prevent you from compiling and running it, a warning is a suggestion to improve your code.

The value of your constant suggests it is a numeric integer value, default in VB.Net is the Integer data type, so defining it "As Integer" does not change the meaning and removes the warning.

If the code in not for VB.Net and you find documentation telling which type of integer it is, you should be aware there are differences between data types in VB.Net and classic VB, the VB.Net Integer data type is a 32-bit signed integer.
 
Back
Top