March 2000
Intermediate to advanced
576 pages
18h 13m
English
Move Procedure
procedure Move(const Source; var Dest; Count: Integer);
The Move procedure copies Count
bytes from Source to Dest.
Move is a real procedure.
Source and Dest are not
pointers, so pass the actual variables, or dereference pointers to
dynamically allocated memory.
Move can handle overlapping memory
correctly.
// Insert an item into the middle of an array. Discard the
// value that is currently at A[High(A)].
procedure ArrayInsert(var A: array of Integer; Value, Index: Integer);
begin
Assert((Low(A) <= Index) and (Index <= High(A));
// First make room for the new value.
Move(A[Index], A[Index+1], (High(A)-Index) * SizeOf(Integer));
// Then save the value in the array.
A[Index] := Value;
end;| FillChar Procedure |
Read now
Unlock full access