VBGamer |
|||||||||||||||||||||||||||
RE: Redefining variables in a type statement Adam Hoult (1 reply, 0 views) (2000-Jun-15) Or you could use a variant type, you can then check the actual type of the variable using the TypeOf operator.
For example
Dim Variable1
Variable1 = 23
If TypeOf Variable1 Is Integer Then Msgbox "INTEGER"
Variable1 = "MyString"
If TypeOf Variable1 Is String Then Msgbox "STRING"
Of course, variants aren't exactly the fastest things on the face of the earth (in fact about as fast as an arthritic snail for tight loops =) But all depends on what you want to do.
Adam
|