Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Official ZPE/YASS documentationArray subscripting

As of version 1.5.3 arrays including lists, associative arrays and strings can all be directly accessed using the square brackets notation (known as the subscript operator). For example:

YASS
$a = [44, 32, 99]
//Will print 44
print($a[0])
  

Previous versions of ZPE must use a function such as the list_get_at_index or the get chained function.

As well as this, it is also possible to go into an array of arrays (or list of lists) as of version 1.6.4. This is achieved due to multiple indexing:

YASS
$a = [[44, 32], [99, 23]]
//Will print 32
print($a[0][1])
  
Comments

There are no comments on this page.

New comment

Comments are welcome and encouraged, including disagreement and critique. However, this is not a space for abuse. Disagreement is welcome; personal attacks, harassment, or hate will be removed instantly. This site reflects personal opinions, not universal truths. If you can’t distinguish between the two, this probably isn’t the place for you.

Comments powered by BalfComment

Feedback 👍
Comments are sent via email to me.