This is a simple class that holds data, and has one function to show you use. The function just returns the name of the object (its a document) in uppercase. There are LOADS of excellent reasons to use classes, but just think of each class as a new box.
You stick stuff in it (the private variables normally) and then ask it for data back. You can tell the box to do something to the data, like return in upper case, or run functions based on the data.
Its also good for passing it data in one format (ie a string) and it can convert to another, or using properties, you can allow an integer to be added to the class, but only if its greater then zero.
If your just getting into how classes work, then keep away from inheritance, overriding, overloading and scope of things until you know how (and where) to use them.
Another thing to note, is that everything is really a class.
A form is a class (it inherits all its functions), a module is a class used once (singleton), controls are instances of classes.
Code:
Friend Class clsDocument
'Unique ID
Private pUniqueID As Integer
'Name of document
Private pName As String
'Owner of this document
Private pOwner As Integer
Friend Sub New()
'Set the defaults
pUniqueID = -1
pName = ""
pOwner = -1
End Sub
Friend Function funcGetNameUpper() as String
return pName.ToUpper()
End Function
End Class