12.5 Array Element Expansion

12.5.1 Synopsis

array_name [index]

12.5.2 Description

If an array called array_name exists and consists in index or more elements, the expression above will be replaced by element number index.

If no array called variable_name exists or it exists but is shorter than index elements, the expression above will be replaced by an empty string and Cows will raise a warning.

12.5.3 Example

array [ ] = { "It's sad. That's a living creature.",
              "We don't have the right to take",
              "their life away for fashion.",
              "-- Carmen Electra" };
print (array [0]);
print (array [1]);
print (array [2]);
print (array [3]);

Here, we simply define an array and display its elements. Cows' output will be:

It's sad. That's a living creature.
We don't have the right to take
their life away for fashion.
-- Carmen Electra

This manual can be downloaded from http://www.g-cows.org/.