In vb.net, how do you treat the members of a structure as an array?

bnsaflsujt

New member
I have created a structure with several varibles included, one of which is a Date variable. Then, for the purposes of my program, I have created an array of the structure. This is working great for me for the most part, but what if I wanted to export all of the Date variable values into a singular date array? For example:

Private Structure Employees
Friend timIn As Date
Friend timOut As Date
End Structure

Dim empPerimeter(0 to 9) As Employees
{Lots of other code, and employees become defined}

Sub sortTimeIn()
'I know the following code won't work, but maybe you can understand what I want from it.
'Basically, the allEmployeesTimeIn array is set to the size of the empPerimeter array,
'and the values in the array are populated with the empPerimeter timIn variable for each element.
'Is there any better way to do this than to use a for loop and do it manually?
Dim allEmployeesTimeIn() As Date
allEmployeesTimeIn = empPerimeter().timIn
End Sub
 
Back
Top