Module:Sequence/doc

This module is intended to provide access to basic sequence functions.

Most of the functions provided here can be invoked with named parameters, unnamed parameters, or a mixture. If named parameters are used, Mediawiki will automatically remove any leading or trailing whitespace from the parameter. Depending on the intended use, it may be advantageous to either preserve or remove such whitespace.

Global options

 * ignore_errors
 * If set to 'true' or 1, any error condition will result in an empty string being returned rather than an error message.


 * error_category
 * If an error occurs, specifies the name of a category to include with the error message. The default category is Category:Errors reported by Module Sequence.


 * no_category
 * If set to 'true' or 1, no category will be added if an error is generated.

len
This function returns the length of the target sequence.

Usage:

OR

Parameters:
 * s
 * The sequence whose length to report

idx
This function returns a single element from the target sequence at index idx.

Usage:

OR

Parameters:
 * target
 * The sequence to use


 * idx
 * The index for the element to return

The first element has an index value of 1.

A requested index value of zero, or a value greater than the length of the sequence returns an error.

some
This function returns a number of elements from the target sequence. The elements' indices are given as a comma-separated list, and are output separated by the given separator (default: comma) Usage:

OR

Parameters
 * target
 * The sequence to use


 * idxList
 * The index for the element to return


 * sep
 * The character sequence to separate output elements

The first element has an index value of 1. A requested index value of zero, or a value greater than the length of the sequence returns an error.