I’ve been having trouble understanding how local coordinates work.
I’m working with 010 Editor 15.0a on Windows 10.
I have a template that looks like this:
OffsetClear();
OffsetSetStartLimit( 4 );
OffsetSetLimitSize( 2 );
Printf( "AddressLocalToFile(0) returned 0x%X\n", AddressLocalToFile(0) );
Printf( "AddressFileToLocal(5) returned 0x%X\n", AddressFileToLocal(5) );
FSeek( 0 );
byte b[2];
I ran the template against a text file that looks like this:
0123456789ABCDEF
Its output looks like this:
AddressLocalToFile(0) returned 0x0
AddressFileToLocal(5) returned 0x5
This output surprised me. I expected AddressLocalToFile(0)
to return 4, and AddressFileToLocal(5)
to return 1.
Yet in the Template Results window I can see that b[0]
and b[1]
do contain the ASCII characters '4'
and '5'
as expected.
(At first I didn’t have the FSeek(0);
in the script but the need for it made sense once I thought about it.)