[Contents] · [Home] · [Mail]

SALIERI Language - ins

ins: string x string x integer -> string
ins: list x list x integer -> list
ins: sequence x sequence x integer -> sequence

Call syntax:
ins(s_1, s_2, int)

ins returns the serial object (string, list, or sequence) obtained by inserting series s_2 into series s_1 just before index position int. The index positions within serial objects are counted 1,2,...,length(s).

The start position int_1 can be a negative value, in which case it is counted from the end of the series (with index position -1 corresponding to length(s)).

Error conditions:
If ins is called with an invalid index position int an error condition occurs.

> name := "A.Salieri";
> piece := "piano concerto B major";
> ins(piece, "in ", 16)
Result="piano concerto in B major"
> ins(name, " (1750-1825)", #name+1)
Result="A.Salieri (1750-1825)"
> ins(name, " (1750-1825)", 12)
Error in command-line:
Wrong startposition
(occurred while executing function "ins")

See also: string (object type), list (object type), sequence (object type), length, del.

[Contents] · [Home] · [Mail]
© sic!systems, page frame designed by hh; this page has been automatically generated from the SALIERI Documentation Database.