The Dimension parameter is a list of lengths for each dimension. For a 3 dimension
array you would use a list of 3 lengths. Each length must be an integer with a value
greater than zero.
The InitValue is the value to set for each element. It can be any Euphoria object.
Note that if the function fails, it returns an integer.
Example
object Space3D Space3D = DIMArray( {3, 7, 4}, 0) if integer(Space3D) then ErrAbort(sprintf("All dimensions must be positive integers; dimension %d is not.", Space3D)) end if--------------------------------------------------------------------------
See Also: False, findAltKey, findKey, iff , insertIndex, removeIndex, removeItem, removeKey, rotate_elements, True
See Also: DIMArray, findAltKey, findKey, iff , insertIndex, removeIndex, removeItem, removeKey, rotate_elements, True
Example:
-- find a value from column 2 in a list integer at at = findAltKey( 2, name, nameList )
See Also: DIMArray, False, findKey, iff , insertIndex, removeIndex, removeItem, removeKey, rotate_elements, True
Example:
-- find a value from a list integer at at = findKey( name, nameList )
See Also: DIMArray, False, findAltKey, iff , insertIndex, removeIndex, removeItem, removeKey, rotate_elements, True
Example
msg = sprintf("%s: %s", { iff(ErrType = 'E', "Fatal error", "Warning"), errortext } )
See Also: DIMArray, False, findAltKey, findKey, insertIndex, removeIndex, removeItem, removeKey, rotate_elements, True
If index is zero or less, the Data is added to the front of the list and if index is passed the end of the list, Data is added to the end of the list.
Example:
-- Insert a new name into position 4 of the list nameList = insertIndex( 4, nameList, "Michael Palffy" )
See Also: DIMArray, False, findAltKey, findKey, iff , removeIndex, removeItem, removeKey, rotate_elements, True
If index is greater than the list length, the list is returned intact. If index is less than 1, it represents the end of the list PLUS the index. So an index of '-1' means the second-last element.
Example:
-- Remove the 4th element from the Name List nameList = removeIndex( 4, nameList ) -- Remove the last element. nameList = removeIndex( 0, nameList )
See Also: DIMArray, False, findAltKey, findKey, iff , insertIndex, removeItem, removeKey, rotate_elements, True
Example
-- Remove the name 'fred' from the list. nameList = removeItem("fred", nameList)--------------------------------------------------------------------------
See Also: DIMArray, False, findAltKey, findKey, iff , insertIndex, removeIndex, removeKey, rotate_elements, True
The difference between this and removeItem is that in this function,
list is a list of sequences and item is found if it matches the
first element in the sequences.
Example
-- Remove the tracked resource. ResourceList = removeKey(hWnd, ResourceList) -- Add new tracked item. ResourceList = insertIndex(0, ResourceList, {hWnd, 0, TagData})--------------------------------------------------------------------------
See Also: DIMArray, False, findAltKey, findKey, iff , insertIndex, removeIndex, removeItem, rotate_elements, True
For each element of list identified in the index set, is moved
Example: -- Swap the 3rd and 4th element. theList = rotate_elements(theList, {3,4}) -- Move 2nd to 8th, 4th to 2nd, 6th to 4th, and 8th to 6th. theList = rotate_elements(theList, {2,4,6,8})
See Also: DIMArray, False, findAltKey, findKey, iff , insertIndex, removeIndex, removeItem, removeKey, True
See Also: DIMArray, False, findAltKey, findKey, iff , insertIndex, removeIndex, removeItem, removeKey, rotate_elements