Stupid Variable Declaration Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Stupid question: In VB.NET how do you group similar variables together? For
example, I have these two fields:

Dim EmployeeFirstName As String
Dim EmployeeLastName As String

Can't first and last name be grouped together in an employee 'group' like
this:

Dim Employee
FirstName As String
LastName As String

so that you can reference the first and last name like this:

Employee.FirstName
Employee.LastName

Thanks!
John
 
The first way can be to realize a class

Class Employee
Public FirstName As String
Public LastName As String
End Class

The other way can be use a structure

Module my
Structure EmployeeInfo
Public FirstName As String
Public LastName As String
End Structure

End Module

Ciao. Nicola
 
Thanks!

Nick said:
The first way can be to realize a class

Class Employee
Public FirstName As String
Public LastName As String
End Class

The other way can be use a structure

Module my
Structure EmployeeInfo
Public FirstName As String
Public LastName As String
End Structure

End Module

Ciao. Nicola
 
Back
Top