Graeme Geldenhuys schreef:
2009/10/8 Jonas Maebe <jonas.ma...@elis.ugent.be>:
SetLength(tocarray, _Header.ntoc);
p := _Data + _Header.tocoffsetsstart;
Move(p, tocarray, SizeOf(tocarray));
This has to be
move(p^, tocarray^, length(tocarray)*sizeof(tocarray[0]));
^
This gives a compiler error. Illegal qualifier and points to the
second ^ in that statement.
move(p^, tocarray, _Header.ntoc*sizeof(tocarray[0]));
Causes a segmentation fault at runtime.
Move(p, tocarray[0], SizeOf(tocarray));
This causes an Access Violation at runtime.
Move the data pointed at by p into the array elements without overwriting the
dynarray meta data structure.
Move(p^, tocarray[0], sizeof(Int32)*_Header.ntoc);
Working with pointers, if you don't get it, maybe just use a loop.
Vincent
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal