Here is my array:
Public RacersArray(AmountOfRacers - 1) As Racer
<Serializable()> Public Structure Racer
Public Name As String
Public CleatSize As String
Public SkillLevel As String
Public Height As String
Public Team As String
Public CompatibilityArr() As String
End Structure
<Serializable()> Public Structure Compatibility
Public Name As String
Public Score As Integer
End Structure
Below is the code I am using to try save and load from file. The file is getting populated with what looks like the correct gibberish, but when loading the array and it's indexes are still 'nothing'
Public Sub RacersInputSAVE()
Dim bf As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
Dim fStream As New FileStream(SaveLocation, FileMode.Create)
bf.Serialize(fStream, InputRacers.RacersArray) ' write to file
fStream.Close()
End Sub
Public Sub RacersInputLOAD()
Dim bf As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
Dim fStream As New FileStream(LoadLocation, FileMode.Open)
InputRacers.RacersArray = bf.Deserialize(fStream) ' read from file
fStream.Close()
End Sub