Insert Procedure
The
Insert
procedure inserts the string
Ins
into the string Str
at the
position Index
. If Index
is
≤ 1, Ins
is inserted at the beginning of
Str
. If Index
is past the end
of the string, Ins
is appended to the end of
Str
.
Insert
is not a real procedure.
// Insert a drive letter at the front of a path.
procedure InsertDriveLetter(var Path: string; const Drive: Char);
begin
// First make sure the path does not have a drive letter in front.
if (Length(Path) < 2) or (Path[2] <> ':') then
// Insert the drive at the start of the path.
Insert(Drive + ':', Path, 1);
end;