The following bidimensional array stores informations about site sections. There are three sections, each identified by a label and a more descriptive string:
sections [ ] = { { "about", "About Us" }, { "docs", "Documentation" }, { "download", "Download our Software" } };
Now, if you want to add a new section you may be tempted to do something like:
section [ ] += { "faq", "Frequently Asked Questions" };
This wouldn't lead to an array made of 4 items, each of them consisting in a 2 element array as expected. On the contrary, this is what you get:
{ { "about", "About Us" }, { "docs", "Documentation" }, { "download", "Download our Software" }, "faq", "Frequently Asked Questions" };
Two string elements have been added, not a array of two strings. The right way to achieve our goals is:
sections [] += { { "faq", "Frequently Asked Questions" } };
This notation can seem redundant, but is necessary since G-Cows can handle multidimensional arrays whose elements have different data types. The extra braces allow to distinguish between adding two strings or adding an array of two strings.
This manual can be downloaded from http://www.g-cows.org/.