Function: AsList
Function: AsList

Function: AsList

AsList ( INPUT )

Returns a value encapsulated in a list, but only if it isn't already.

Parameters

Parameter Type Description
INPUT VALUE The input value (any type).

Returns

VALUE(LIST) The list value of the input value.

What It Does

This function returns the input value or expression result as a list with a single element - itself.

If the input was originally a list, it is returned as-is. This function does not change or convert a value in-place - you must reassign the result.

Example

AsList Example


world
{
	start()
	{
		local a;
		a = 3;
		textln("a = "+a);
		textln("a[0] = "+a[0]);
		textln("asList(a) = "+asList(a));
		
		a = [3];
		textln("a = "+a);
		a = asList(a);
		textln("a = "+a);
		quit;
	}
}
×

Modal Header