TinyMUX

Itext()

Functions

FUNCTION: itext(<n>)

When called within an iter() or parse(), returns the equivalent of the ## substitution, with reference to the nth more outermost iter(), where n=0 refers to the current iter(), n=1 to an iter() in which the current iter() is nested, and so on.

Unlike the ## and #@ substitutions, which are substituted into the evaluation string before it is evaluated, itext(), inum(), and ilev() substitute their values as part of evaluation. In this way, the use of these functions is safer than the ## and #@ substitutions and is therefore preferred.

Examples:

> say [iter(red blue green,iter(fish shoe, #@:##))]
You say, "1:red 1:red 2:blue 2:blue 3:green 3:green"

> say [iter(red blue green,iter(fish shoe, [inum(1)]:[itext(1)]))]
You say, "1:red 1:red 2:blue 2:blue 3:green 3:green"

> say [iter(red blue green,iter(fish shoe, [inum(0)]:[itext(0)]))]
You say, "1:fish 2:shoe 1:fish 2:shoe 1:fish 2:shoe"

> say [iter(red blue green,iter(fish shoe, [itext(1)]:[itext(0)]))]
You say, "red:fish red:shoe blue:fish blue:shoe green:fish green:shoe"

Related Topics: Softcode functions, iter(), inum(), ilev().