G
Guest
I have old legacy code from vb5 where data was written to a file with a
variant declaration (this was actually a coding error?)...
in vb5 the code was:
Dim thisdata as integer
Dim thatdata
Dim someother as integer
thatdata = ubound( Array1 )
Put 1, , thisdata
Put 1, , thatdata
Put 1, , someother
So "thatdata" was variant by default, then given an integer by ubound?
Now I need to read the old files created from this code using vb.net. I cant
figure out how to declare the variables.
I have tried declaring all the types I know of ie short, integer, single,
tried strings etc.
In vb.net I use:
Dim thisdata as short
Dim thatdata as ?????
Dim someother as integer
FileOpen(1, FileName$, OpenMode.Binary, OpenAccess.Read)
FileGet(1, thisdata )
FileGet(1, thatdata )
FileGet(1, someother )
The data is good until thatdata, then everything is junk.
What would the old vb5 code have written in this case? Must have choosen
some format? How can I read it now in vb.net? I realize the variant was
dropped/changed in .net? But I still need to read the old files.
BTW, this is a simplified version of the actual code/file structure where I
have the problem. I have not tried the above code and not sure it will
duplicate the problem exactly.
It is very important to be able to read these old data files.
Thanks in advance,
Tom
variant declaration (this was actually a coding error?)...
in vb5 the code was:
Dim thisdata as integer
Dim thatdata
Dim someother as integer
thatdata = ubound( Array1 )
Put 1, , thisdata
Put 1, , thatdata
Put 1, , someother
So "thatdata" was variant by default, then given an integer by ubound?
Now I need to read the old files created from this code using vb.net. I cant
figure out how to declare the variables.
I have tried declaring all the types I know of ie short, integer, single,
tried strings etc.
In vb.net I use:
Dim thisdata as short
Dim thatdata as ?????
Dim someother as integer
FileOpen(1, FileName$, OpenMode.Binary, OpenAccess.Read)
FileGet(1, thisdata )
FileGet(1, thatdata )
FileGet(1, someother )
The data is good until thatdata, then everything is junk.
What would the old vb5 code have written in this case? Must have choosen
some format? How can I read it now in vb.net? I realize the variant was
dropped/changed in .net? But I still need to read the old files.
BTW, this is a simplified version of the actual code/file structure where I
have the problem. I have not tried the above code and not sure it will
duplicate the problem exactly.
It is very important to be able to read these old data files.
Thanks in advance,
Tom