Lasso Soft Inc. > Home

[ staticarray->get ]

Method

[staticarray->get] returns an item from the array.

Accepts a single integer parameter identifying the position of the item to be returned.

The first element in an array is at position 1.

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

  • Syntax
staticarray->get(array_position)
Examples
  • Beginner

To return an element from an array:

Use the staticarray->get method to return an item from an staticarray with a particular index.

The following example returns the second item from an array of the days of the week.

Code

var(DaysOfWeek = staticarray('Sun','Mon','Tue','Wed','Thu','Fri','Sat'))
//display the second element
$DaysOfWeek->get(2)

Result

Mon

Recent Comments

No Comments found

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 2014 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft