Accessing Members
Unless you declare shared objects, you need to instantiate classes and structures before you can use members and store information within those objects. You instantiate a class declaring a variable and using the New keyword as in the following line of code:
Dim testPerson As New Person
Then you can set properties for the new instance or eventually invoke other members such as methods. For example, you could initialize testPerson’s properties as follows:
testPerson.FirstName = "Alessandro" testPerson.LastName = "Del Sole"
Basically when you need to invoke a member of a class, you type the name of the instance (in this example testPerson) followed by a dot and by the name of the member. For shared members, you just write the name ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access