@Select (JavaScript)

Returns a value from a parameter list.

Defined in

@Functions (JavaScript)

Syntax

@Select(position:int, list:...) : string
Parameter Description
position The number of a value in the list. Parameter 2, the first value in the list, is at position 1.
list Any number of values of any type. The value can be an array.
Return value Description
string The value at the specified position, or an empty string if the position is out of range.

Examples

function p(stuff) {
	print("<<<" + stuff + ">>>");
}

function getMonth(n) {
	return(@Select(n, "January", "February", "March",
		"April", "May", "June", "July", "August",
		"September", "October", "November", "December"));
}

for(var i = 1; i < 13; i++) {
	p(getMonth(i));
}