I'm updating some spaghetti that consistently uses an undeclared
variable that I guess (based on context) is supposed to be interpreted as a String. The code both compiles and executes successfully.
How is this possible?:eek2:
Printable View
I'm updating some spaghetti that consistently uses an undeclared
variable that I guess (based on context) is supposed to be interpreted as a String. The code both compiles and executes successfully.
How is this possible?:eek2:
It is probably being considered a Variant.
Are you going through and predeclaring them as they should be?
Not sure what a Variant is. And I am predeclaring as I add new code to thisQuote:
Originally Posted by Hack
already existent disaster that got dropped in my lap.
So what is a Variant? (I'm new to VB...this forum and the MSDN website
are my only available references.)
Thanks.
So if I'm reading this properly, it is indeed possible to not declare
a variable and then VB assumes it's a variant?
P.S. - coming from someone who's done a lot of Ada, C++ and some Java
isn't this kind of bad practice?
That would depend on how the IDE is set up. The norm would be to have the compiler (and the IDE) insist that all variables are declared before being used.
Yes.... For some reason MS developers thought it would be handy to have VB default to not declaring variables unless Option Explicit is declared. Go figure!Quote:
Originally Posted by tlwtheq
Ahhh, MS developers. That explains a lot.Quote:
Originally Posted by CDRIVE
Thanks everyone.:)