Results 1 to 6 of 6

Thread: Structure cannot be indexed because it has no default value

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2010
    Posts
    14

    Structure cannot be indexed because it has no default value

    Hi Guys,

    Can anyone tell me what I'm missing here:

    Code:
    Structure EmployeeData
        Dim EmployeeName As String
        Dim JobTitle As String
        Dim TaxRate As Single
    End Structure
    
     Public Sub OpenEmployeeFile(ByVal ViewForm As Object, ByVal ListBox As Object)
    
            Dim EmployeeList As EmployeeData = Nothing
            nEmployees = 0
            ViewForm.EmployeeListBox.Items.Clear()
    
            FileOpen(1, "EmployeeData.epc", OpenMode.Binary, OpenAccess.Read)
    
            While Not EOF(1)
                FileGet(1, EmployeeList)
                EmployeeArray(nEmployees) = EmployeeList
                ViewForm.ListBox.Items.Add(EmployeeList.EmployeeName)
    
            End While
        End Sub
    Last edited by ssjaronx4; Mar 8th, 2010 at 03:44 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width