[RESOLVED] Side question about UDTs
I defined a UDT in these terms,
Type Curve
n As Integer
x() As Single
y() As Single
End Type
Then after I close the IDE and go back to the project at a later time I find the single variables have been converted to upper case
X() As Single
Y() As Single
Not that it matters much but I like them lower case and I just have no idea why this happens.
Re: Side question about UDTs
VB6 saves variable names globally...
For example, make 2 functions/subs, both of them with the same variable name (with same type or diferent type, it does not matter), then change the Cation on one of the variables, and see what happens with the other in the ohter function...
For example
Code:
Private Sub Func1()
Dim TestVariable As String
End Sub
Private Sub Func2()
Dim TestVariable As Integer
End Sub
Just change "TestVariable" to "Testvariable", and see what happens
This hapened to me a lot, and it is quite anoying, especially when you include a module/class (that is not made by me) using same variable names as I do. It took me a long time to figure out why I cannot change the variable name, and it always jumps to some other caption state...
Re: Side question about UDTs
Quote:
Originally Posted by CVMichael
VB6 saves
variable names globally...
For example, make 2 functions/subs, both of them with the same variable name (with same type or diferent type, it does not matter), then change the Cation on one of the variables, and see what happens with the other in the ohter function...
For example
Code:
Private Sub Func1()
Dim TestVariable As String
End Sub
Private Sub Func2()
Dim TestVariable As Integer
End Sub
Just change "Test
Variable" to "Test
variable", and see what happens
This hapened to me a lot, and it is quite anoying, especially when you include a module/class (that is not made by me) using same variable names as I do. It took me a long time to figure out why I cannot change the variable name, and it always jumps to some other caption state...
Well, thanks for clarifying the issue. I smelled something like this but wasn't sure exactly what it was. I'll have to be more imaginative with my variable names, still x,y for coordinates are very intuitive.