toline

Purpose

Converts the argument to a line it is found in.

Syntax

toline($group)

Arguments

Takes one required argument which is a reference to a named group a user wants to format.

The function also takes the following optional named parameters:

Parameter

Comments

match:=range/arguments

If arguments are discontinuous and they are extracted within several sentences, only these sentences appear in the result. When the optional named parameter match:=range is switched on, the argument is converted to the whole text fragment from the first sentence till the last one.

first:=<numeral>

If the argument is omitted, the parameter is treated as a range of values. Otherwise, it specifies the offset of the start position.

last:=<numeral>

If the argument is omitted, the parameter is treated as a range of values. Otherwise, it specifies the offset of the end position.

separator:=<string>

The user can indicate a custom separator. If it is not specified, default separator "\n" is used.

Notes

  • The parameters first and last may be used independently, without specifying the argument found by a search query.

  • When using the first and last parameters, in case of a discontinuous argument (or when arguments are omitted), duplicate elements found by the search query are not removed (firstly, the range from first to last for the first found result is formatted, then for the second found result, etc. The intersecting sets are not removed for the convenience of results analysis.

Returned Value

The returned data type is text.

Examples

toline(first:=1, last:=3) converts the result to the first three lines of the document.

toline($m, first:=-1, last:=1) converts the named group $m to one line before it and one line after it.

toline($m, first:=-1, last:=1, match:=range) extracts the whole text fragment from the first line till the last one containing the named group $m, a line before it and a line after it.