Reading VB6 three-dimensional array in FreePascal/Lazarus -
i wonder how decode three-dimensional dynamic array of custom type written binary file in vb6.
the custom type defined follows:
type xybyte x byte y byte end type it represents 2 coordinates of contact point.
the three-dimensional array represents pre-computed contact point positions minigolf track relief. track viewed two-dimensional height map. each possible ball position on map, contact points computed there can more map coordinate, hence third dimension.
dim contactpointmap() xybyte redim contactpointmap(width - 1, height - 1, maxcontactpointcount - 1) that array gets saved binary file includes track shape.
open filename binary #1 ... put #1, , contactpointmap() ... close #1 ok, how did in vb6. re-write mini-golf simulator in fpc/lazarus , wonder how decipher three-dimensional array data witten vb6.
it's interesting it's pretty straightforward read two-dimensional array of "single" precision float values use relief map , source contact point calculation:
dim map() single redim map(width - 1, height - 1) the data saved in logical order. can recognize rows , columns , reading goes well.
but three-dimensional contact point map, every try read fails. used hexeditor see binary data , it's stored in way can't understand.
ok, can read relief map , backup option, can re-compute contact points in fpc, change format , save contact point map in non-cryptic way. btw, stored information in track files speed reasons (it faster read array on play time calculate it).
i no longer have access vb6. have code , compiled executable.
but know how decipher three-dimensional dynamic array of user-defined type written visualbasic 6?
it clears out used damaged data research.
and had bad dimension sizes.
and wasn't clear dimension order in algorithms.
only array data saved file, coding first dimension @ first place, second, , on.
the coding of three-dimensional array same straightforward every other multi-dimensional array.
this link marco van de voort helped me out: http://www.codeguru.com/vb/gen/vb_misc/algorithms/article.php/c7495/how-visual-basic-6-stores-data.htm
Comments
Post a Comment