March 2000
Intermediate to advanced
576 pages
18h 13m
English
Insert Procedure
procedure Insert(const Ins: string; var Str: string; Index: Integer);
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.
The first character of a string has index 1.
// 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;| Copy Function, Delete Procedure, SetLength Procedure, SetString Procedure |
Read now
Unlock full access