I thought GPC handled array splices, but this:
program peter109;
type MyArray(count: Integer) = array[1..count] of Integer; var p: ^MyArray; begin New(p,10); p^[1..5] := p^[2..6]; end.
Gives a compiler error:
peter109.pas:9: error: type mismatch in array assignment
It works for strings, but I guess strings have all that packed array of char type checking extra baggage.
Should I just go back to BlockMoveData, or is there a way for array splice assignments to work, and if so, are they safe for overlapping moves?
While I'm at it, is there any better way to zero part of such an array than:
FillChar( p^[3], 4 * SizeOf(p^[3]), 0 );
And further while I'm at it, I looked at the docs for MoveLeft et al, and they are all under construction. Would it be worth while setting up a wiki for the docs? The docs already have an organizational layout, which is very helpful for starting a wiki and letting others add information. I've never set up a wiki before, but I'd be happy to set it up and look at transferring the existing documentation over if people thought it was a good idea. I know the docs are all tied in with the make system, and there might be some loss with regard to automation of that, but on the other hand it might mean more people participate in improving the docs so it might be an overall win. Anyway, just a thought, if there is no interest, I'll go back to reading move.pas to figure out what the RTS does ;).
Thanks, Peter.