Sign in to follow this  
Followers 0
atrX

Scripting Basics: Arrays

1 post in this topic

What is an array?

Arrays are used to store multiple values in a single variable, every value is accessible by its index. Arrays in CoDScript are 0 indexed, meaning the array indexes start from 0.

 

Declaring an array

An array in CoDScript is declared as follows:

Please login or register to see this code.

 

Storing data in an array

You can manually store data in an array:

Please login or register to see this code.

CoDScript also has many different functions that will return an array, here's a few examples:

Please login or register to see this code.

 

Retrieving data from an array

Retrieving data from an array is simple and works with array's indexes:

Please login or register to see this code.

 

Multidimensional arrays

Multidimensional arrays are basically embedded arrays. What this means is that you are able to store arrays within other arrays.

Here's a short example of an embedded array:

Please login or register to see this code.

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0