I have the following structure:
Public Structure Aliment
Public Alino As Integer
<VBFixedString(83)> Public NomUS As String
<VBFixedString(50)> Public NomFR As String
<VBFixedString(24)> Public Categ As String
Public Paramali() As Double
Then I have an array of this structure
Public TousALI() As Aliment
The array Paramali() is redimensioned:
ReDim Preserve TousALI.Paramali(80)
The data stored in the TousALI array, comes from a .txt file.
I load it, display it in a datagridview and it works perfectly.
But now I want to store the data in a random access file:
FileOpen(1, FileAliRand, OpenMode.Random, OpenAccess.Write, , 813)
But the next line :
FilePut(1, TousALI(I)) gives me an error: Incorrect record length.
the record lenght, 813 is the total number of bytes.
How to calculate the actual number of bytes of my array ?
Thanks for help
What I have tried:
I have tried many different length, but it doesn't work