tags:

views:

53

answers:

3

If one declares a VB6 variable thus...

Public THISVAR, THATVAR, THEOTHERVAR

what type are the variables created?

+9  A: 

Variant -> see Variant Types

Keith
Probably, but not always!
wqw
**Nearly** always true. If the original programmer really wanted to confuse you, the Def*Type* statements can change the defaults module-by-module and by the initial letter of the variable name. VB6 manual http://msdn.microsoft.com/en-us/library/aa263421(VS.60).aspx
MarkJ
+1  A: 

They'll be Variants - able to contain anything.

Damien_The_Unbeliever
+1  A: 

It depends.

Usually these end up being Variants but you can use DefXxx statements to alter default data types based on first letter of a variable name which is kind of weird legacy feature.

We use DefObj A-Z in all our modules immediately after Option Explicit so that typeless vars, params and retvals (not allowed here by coding conventions) end up being As Object and usually generate compile-time errors or crash in flames at run-time.

So in your case these would be Nothing (uninitialized As Object var) if this declaration happen to be one of our modules.

wqw