IntArray

HC Data Structure Primitives Constructors IntArray
Array Int16Array

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


outputs an IntArray of "size" members (must be a positive integer), each of which is an Int. Array members can be selected with Item and changed with setItem. The first member of the IntArray is member number 1 unless an "origin" input (must be an integer) is given, in which case the first member of the IntArray 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 anint16array to IntArray, while clipping the values to the max and min integer. It can also be used to clone anintarray.

Examples:

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

Examples:

References:

Array Int16Array