Hi all,
I have a binary (database)file. The structure is simpel:
4x string with fixed length and containing general info
1x long value indicating nr of parameters
1x long value indicating nr of locations
a list with strings with the parameternames
a list with strings with the locationnames
then all data for each parameter/location/timestep
in VB6 with the Get-statement it reads a record and i don't have to specify the number of characters to be read. In VB.Net (2005beta) i tried this:
Dim BR As New IO.BinaryReader(IO.File.OpenRead(sPath & "\" & sfilename))
reading header, nr of locations, parameters and redim array's
so far, this works fine
...
For i = 0 To lNrOfParameters
asParameters(i) = BR.ReadString
Next i
...
This is where my code 'fails', the strings are not correct, ReadString seems to have a fixed length and i don't know the length of each parameter-string. How can i solve this?
Best regards,
John
I have a binary (database)file. The structure is simpel:
4x string with fixed length and containing general info
1x long value indicating nr of parameters
1x long value indicating nr of locations
a list with strings with the parameternames
a list with strings with the locationnames
then all data for each parameter/location/timestep
in VB6 with the Get-statement it reads a record and i don't have to specify the number of characters to be read. In VB.Net (2005beta) i tried this:
Dim BR As New IO.BinaryReader(IO.File.OpenRead(sPath & "\" & sfilename))
reading header, nr of locations, parameters and redim array's
so far, this works fine
...
For i = 0 To lNrOfParameters
asParameters(i) = BR.ReadString
Next i
...
This is where my code 'fails', the strings are not correct, ReadString seems to have a fixed length and i don't know the length of each parameter-string. How can i solve this?
Best regards,
John