GoFiler Legato Script Reference
Legato v 1.5d Application v 5.25a
|
Table of Contents | < < Previous | Next >> |
Chapter Three — Data Types and Operators (continued)
For most operations, intimate knowledge of how data is stored by the language is not required. However, there are certain times when it is necessary to ‘get into the weeds’ either to interface with some external data or program. In such cases, it is essential to understand how data is organized in memory.
All information, no matter how large or small, will be represented as binary information within computer memory or on some media. Legato variable data are stored in several modes that either allow for grouping or does not allow for grouping. For example, if six separate int values were created:
int a, b, c, d, e, f;
These would not be collocated in memory. So, if one was to reference the actual memory address of a (also known as using a pointer), b would not directly follow a. This is because each variable’s control information contains just enough memory to hold a typical variable (64-bits).
Instead, consider the following:
int a[6];
In this case, an area of memory is allocated for a. Therefore, the data for array index 1 will directly follow the 0th element. This is said to be contiguous memory.
All variables that are allocated in arrays with the exception of string types will be contained in contiguous memory. An individual string will have its characters collocated but for an array of strings, each string will be in a different location and may not even be in order in memory. The string array contains a series of string control blocks that, in turn, contain the location, allocated size, and used size.
The size of each unit depends on the data type. For example, char and byte arrays will contain one byte for each element while an array of int types will be 32-bits or four bytes for each element.
Memory organization for lists is as expected. The 0th element is first followed by each element to the nth element. Tables are organized by rows and cells for each column. Therefore, for a 10 x 10 table, a[0][0] references the 0th element and a [1][0] references the 10th element. The organization is conducive to adding and deleting rows easily. Cubes are organized by z planes, y rows, and x columns.
As mentioned above, string arrays are not contiguous. A single string or string element is treated as an expandable character array.
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.