H (Hybrid) Language - v0.03, by Dr. Herong Yang
array.set() - Update Element of Array
This section describes array.set() function that update a character to a string at a given location.
array.set() function is provided to update the array element of a given location using the following syntax:
array.set(a, i, x) Parameters: a - A "array" data object. i - A "integer" data object. x - A data object. Return: Returns the same "array" data object reference by "a" with element at location of "i" updated to "x". Errors: Throws "IndexOutOfBound" error code, if the given integer points to a location outside of the range of array element index.
Examples of how to use array.set() function:
array.set([1, "Two", 3], 1, "2"); # Returns array of [1, "2", 3] y = array([1, "Two", 3]); array.set(y, 1, "2"); # Returns array of [1, "2", 3] array.set(y, -1, "?"); # Gets the "NegativeIndex" error.
Table of Contents
array.get() - Retrieve Element from Array
x[i] - Array Element Format for array.get()
►array.set() - Update Element of Array
x[i] - Array Element Format for array.set()
array.subArray() - Sub-Array Function
Inheritance - Object Attachments