Lasso Soft Inc. > Home

[Array->Get]

[Array->Get] returns an item from the array. Accepts a single integer parameter identifying the index of the item to be returned.

The first element in an array is at index 1.

This tag can be used as the left parameter of an assignment operator to set an element of the array.

An error will be returned if an item is requested which is greater than the size of the array.

  • Syntax
  • Parameters
[Array->(Get: Array Index)]

[Array->(Get: Array Index)=New Value]
Required Parameters
Array The array whose element should be returned.
Array Index The index of the element from the array which should be returned.
Examples

To return an element from an array:

Use the [Array->Get] tag to return an item from an array with a particular index. The following example returns the second item from an array of the days of the week.

[Variable: 'DaysOfWeek'=(Array:'Sun','Mon','Tue','Wed','Thu','Fri','Sat')]
[Output: $DaysOfWeek->(Get: 2)]
Result:
Mon
Tag Link [Array->Get] Category Array
Type Member Data Source Any
Support Preferred Version 5.0
Output Type Any Security None
Implementation Internal Sets Lasso 6.0, Lasso 5.0

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft