Russ Whitaker wrote:
Again, I didn't see this in any FAQs or in the Bug List, so I am going to post the question. The Moveleft and Moveright functions should basically take a source and destination and copy the length number of bytes (from the left or right respectively), correct? That is how it worked with the old compiler I had, but I think we have come to the conclusion that it is horribly nonstandard, and since there are no help files on moveleft and moveright on the GPC page, I have to ask, and then ask if this is a bug.
A while back wrote a simple text editor for my own amusement. The attachment is the unit using shiftleft and shiftright from that editor.
That's an example of correct usage (applied to the characters within a string, i.e. MoveRight (s [...], ...)). This also most likely works with every other compiler that implements this routine, since AFAIK that's what Move, MoveLeft, MoveRight and FillChar were originally designed for in UCSD Pascal.
Side note: Recent GPCs don't require {$X+} for SetLength anymore.
Of course, in most cases the existing string operations (which use MoveLeft etc. internally) are sufficient already, e.g. Insert, Delete, Copy, or here (as Maurice pointed out) a simple assignment, i.e. TestVar2^ := TestVar1^.
Frank