Does anybody know what this prints 1,0,0,0 rather than 0,0,0,1?
My guess is that the Object structure pads the field variable. e.g. 1 fits in 1 byte so pads with 3 X'00' bytes to make the 4 byte int or simply writes it back-to-front.
Am I missing something?
Type ttest Field TG End Type mynew:ttest = New ttest mynew.tg=1 'mynew.tg=256 Print "Sizeof : " + SizeOf(mynew) Local mybank:TBank=CreateStaticBank(mynew,SizeOf(mynew)) For x = 0 To BankSize(mybank)-1 Print "Byte"+x+" "+PeekByte(mybank,x) Next Local myfile:TStream=WriteStream("empty.txt") WriteBank(mybank,myfile,0,BankSize(mybank)) CloseFile myfile
My guess is that the Object structure pads the field variable. e.g. 1 fits in 1 byte so pads with 3 X'00' bytes to make the 4 byte int or simply writes it back-to-front.
Am I missing something?