Int16Array

HC Data Structure Primitives Constructors Int16Array
IntArray FloatArray

Int16Array size
(Int16Array size origin)
Int16Array anarray
Int16Array alist
Int16Array anintarray
Int16Array anint16array


outputs an Int16Array of "size" members (must be a positive integer), each of which is an Int16. Array members can be selected with Item and changed with setItem. The first member of the Int16Array is member number 1 unless an "origin" input (must be an integer) is given, in which case the first member of the Int16Array has that number as its index. (Typically 0 is used as the origin if anything.) Arrays are printed by print and friends. This primitive also can be used to convert alist, anarray or anintarray to Int16Array, while clipping the values to the max and min 16 bit integer. It can also be used to clone anint16array.

Examples:

show Int16Array 3		;Int16Array {0 0 0}
show (Int16Array 3 0)	;Int16Array {0 0 0}@0
show Int16Array {1 2 3}	;Int16Array {1 2 3}
show Int16Array [1 2 3]	;Int16Array {1 2 3}
show Int16Array intarray {1 2 3}	;Int16Array {1 2 3}
show int16array {a b c}	;  int16array doesn't like {a b c} as input
show Item 3 int16array [1 2 3]	;3

Examples:

References:

IntArray FloatArray