i am reading a tutorial that is telling me to dim a variable as taginfo
Dim CurrentTag As TagInfo
the compiler doesnt like this comment, and causes it to crash.
:eek2: :eek2: :eek2: :eek2: :eek2: :eek2: :eek2: :eek2: :eek2: :eek2: :eek2:
Printable View
i am reading a tutorial that is telling me to dim a variable as taginfo
Dim CurrentTag As TagInfo
the compiler doesnt like this comment, and causes it to crash.
:eek2: :eek2: :eek2: :eek2: :eek2: :eek2: :eek2: :eek2: :eek2: :eek2: :eek2:
Crash? Or an error something like "User-Defined type not defined"? (forgot what the actual error is).
The tutorial should have a declaration of that type.
vb Code:
Type taginfo 'members here End Type
You will need to paste this into the general declarations of your code. What is the link to the tutorial you are reading?
http://www.developerfusion.co.uk/show/62/3/
but I see now how the code works, but it is the first time that I have seen a user defined type used. What is the purpose?
To create your own data type...sometimes string, integer, double, etc. is not what we need. Sometimes we need more values:Quote:
Originally Posted by VBNewbieReady2Learn
vb Code:
Type Person strFirstName As String strLastName As String strEmail As String strPhoneNumber As String 'etc... End Type Private udtPerson As Person Private Sub Form_Load() With udtPerson .strFirstName = "Billy" .strLastName = "Bob" .strEmail = "[email protected]" .strPhoneNumber = "1-555-555-5555" End With End Sub
There are a lot of things you can do with UDTs...create arrays of them, save them directly to disk, etc.