H (Hybrid) Language - v0.03, by Dr. Herong Yang
array.get() - Retrieve Element from Array
This section describes array.get() function that retrieves the element from an array at a given location.
array.get() function is provided to retrieve the element of a given location using the following syntax:
array.get(a, i) Parameters: a - A "array" data object. i - A "integer" data object. Return: Returns the data object from "a" at the location of "i". Location zero, 0, is the first element of the array. 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 string.get() function:
array.get([1, "Two", 3], 1); # Returns "Two" y = array([1, "Two", 3]); array.get(y, 1); # Returns "Two" array.get(y, 3); # Gets the "IndexOutOfBound" 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