[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Insert                   Inserts a Substring into a String

 Insert(Source : <string>; var Dest : <string>; Start : Integer);        [TP]

    Inserts the substring Source into the string Dest at location Start.

          Source    Any string value (constant, variable, function call or
                    expression).

            Dest    Any string variable.

           Start    An integer value; position within Dest to insert
                    Source. Should be in the range 1..Length(Dest).

          Notes:    If Start is not in the range 1..255, a runtime error
                    17 ($11) is generated.

                    If Start is greater than the length of Dest, the
                    string Source is concatenated to Dest.

                    If the result of the Insert procedure produces a
                    string larger than the maximum length of Dest, Dest is
                    truncated from the right so that it is not larger than
                    its maximum length.

  -------------------------------- Example ---------------------------------

           Name := 'Rufus Jones';
           Insert('P. ',Name,7);    { insert middle initial }
                                    { Name is now 'Rufus P. Jones' }

See Also: Concat Delete Copy
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson