|
Cluster arrays in sheerpower are powerful tools that function similarly to in-memory spreadsheets. They allow you to efficiently store, manipulate, and retrieve data in rows and columns, making them ideal for handling information like spreadsheets. In this lesson, we'll explore the main features of cluster arrays and how to use them in sheerpower.
Let's start by creating a cluster array called student
to hold information about students. Each row in this cluster will represent a different student, and we'll track each student's name, age, and grade level.
Instructions: Click the COPY button above to paste the code into the text area, and then click RUN to execute the code.
We can add more students to the cluster by adding new rows. Each row stores information about a different student.
Instructions: Click the COPY button above to paste the code into the text area, and then click RUN to execute the code.
To work with cluster arrays effectively, you need to know how to check the number of rows, which row is current, and how to switch between rows.
Instructions: Click the COPY button above to paste the code into the text area, and then click RUN to execute the code.
To operate on each row in a cluster array, you can use the COLLECT
and END COLLECT
statements. Let's print the name, age, and grade level of each student and calculate their average age.
Instructions: Click the COPY button above to paste the code into the text area, and then click RUN to execute the code.
Cluster arrays allow you to sort and filter data efficiently. Let's sort the students by their name and then include only those older than 16.
Instructions: Click the COPY button above to paste the code into the text area, and then click RUN to execute the code.
Use the FINDROW()
function to search for specific data in a cluster array. This function is highly optimized and can perform millions of searches per second.
Instructions: Click the COPY button above to paste the code into the text area, and then click RUN to execute the code.
In this lesson, you've learned how to work with cluster arrays in sheerpower, including how to create cluster arrays, add rows, iterate through them, sort and filter data, and search for specific information. Cluster arrays are a powerful feature in sheerpower, offering dynamic and efficient data management. Keep practicing to master cluster arrays and enhance your sheerpower programming skills!
Hide Description
|
|
Enter or modify the code below, and then click on RUN |
Looking for the full power of Sheerpower?
Check out the Sheerpower website. Free to download. Free to use. |