Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Excerpt
hiddentrue

setElement(array, item, value) Sets the value of an item at a specified index position within an Array or Recordset.


Function: setElement()

Sets the value of an item at a specified index position within an Array or Recordset. 

Syntax

  1. setElement(array, item, value)
ArgumentTypeDescription
arrayArray or RecordsetThe Array or Recordset to evaluate
itemIntegerThe position of the item in array to be returned.
valueIntegerThe value the item in array will be set to.

If item is not a valid entry, this function will cause the script to generate and error and stop processing.

Examples

setElement(["Red", "Green", "Blue"], 2, "Red")

Sets the 2nd element of the array, "Green", to be "Red", i.e.g.

["Red", "Red", "Blue"]

Please note that setElement() cannot be used on recordsets, only arrays. 

See Also