INSLINES

The INSLINES function inserts one or more lines into a multiline text expression.

Return Value

TEXT or NTEXT

This function accepts TEXT values and NTEXT values as arguments. The data type of the return value depends on the data type of the values specified for the arguments:

  • When all arguments are TEXT values, the return value is TEXT.

  • When all arguments are NTEXT values, the return value is NTEXT.

  • When the arguments include both TEXT and NTEXT values, the function converts all TEXT values to NTEXT before performing the function operation, and the return value is NTEXT.

Syntax

INSLINES(text-expression lines [after])

Parameters

text-expression

A multiline expression into whose values one or more lines are to be inserted.

lines

An expression that represents one or more lines of text that you insert into text-expression.

after

An INTEGER that represents the line number after which the specified lines are to be inserted. The position of the first line in text-expression is 1 (one). To insert lines at the very beginning, specify 0 (zero) for after. When you omit this argument, INSLINES inserts the new lines after the last line of text-expression.

Examples

Example 7-122 Inserting Text Lines

This example shows how to insert a new line into a multiline text value in a variable called mktglist with the following value.

Salespeople
Products
Services

The INSLINES function

INSLINES(mktglist, 'Advertising', 2)

returns the following.

Salespeople
Products
Advertising
Services