'-------------------------------------------------------------------------------
Option Explicit

Private Vector As New ByteVectorDataRW   ' Read-write.
'-------------------------------------------------------------------------------
Public Sub Main()

    Dim N As Byte
    Dim B As Byte

    Call Vector.Source("ByteVector.txt")

    Debug.Print
    Debug.Print "   Data using object access:"

    For N = 1 To 5
        Debug.Print "      Vector("; CStr(N); ") = ";
        Debug.Print Cstr(Vector(N))
    Next

    Debug.Print
    Debug.Print "   EEPROM address of Vector:  ";
    Debug.Print CStr(Vector.DataAddress)

    Debug.Print
    Debug.Print "   Data using direct EEPROM access:"

    For N = 0 To 4   ' Note shift to 0-base.
        Call GetEEPROM( Vector.DataAddress + CLng(N), B, 1 )
        Debug.Print "      Vector("; CStr(N+1); ") = "; CStr(B)
    Next

    ' Modify the second element upon first download.
    If ( FirstTime() ) Then
        Vector(2) = 255
    End If

End Sub
'-------------------------------------------------------------------------------
