z80jim, I'm trying exactly the same thing at the moment.
I have tried...
<this is from scratch rather than an actual program>
However, checking the output file using Hex Editor shows some of the characters transposed.
Not sure why yet but it might be the fact I have the wrong field type in my Object (long story).
You might want to try it and see what happens but, it's likely, an instance isn't in contiguous memory.
<edit> Hmmm, might try...
I have tried...
mynew:Ttest = new Ttest field blah, blah blah end type. local Myptr:byte ptr = byte ptr(mynew) myfile:tStream=writefile("output.dat") for count = 0 to sizeof(mynew) writebyte(myfile,myptr[count] next closefile myfile.
<this is from scratch rather than an actual program>
However, checking the output file using Hex Editor shows some of the characters transposed.
Not sure why yet but it might be the fact I have the wrong field type in my Object (long story).
You might want to try it and see what happens but, it's likely, an instance isn't in contiguous memory.
<edit> Hmmm, might try...
Local mybank:TBank=CreateStaticBank(mynew,SizeOf(mynew)) Local myfile:TStream=WriteStream("decs1.txt") WriteBank(mybank,myfile,0,SizeOf(mynews)) CloseFile myfile