Data Section

The data section is located at the first portion of the virtual address space within the GPC bytecode and contains static values which cannot be altered during run time.

The main purpose for the data section is to store static information and the size of it is determined by the values within it. The static values can be accessed in a GPC through the use of an indexer and definitions can also be used if they are placed before the data section, as shown below.

Definitions
define myValue = 255;

//Index No.   0   1   2   3        4  5    6  7   8    9   10
data (        20, 42, 35, myValue, 1, 100, 0, 86, 255, 11, 2  );       

int a, b, c;

main {
    a = dbyte(3);    //a = 255
    b = dchar(3);    //b = -1;
    c = dword(3);    //c = 511;
}

Functions

The values placed within the data section are expressed in bytes (8 bit unsigned integer). The index is zero based. As you can see above, the first value is index point 0 (zero) and the 11th value would be index point 10.

dbyte Function

a = dbyte(3);    // a = 255

This function returns a byte value (8 bit unsigned integer) from the selected index within the array.

Syntax

dbyte ( <index>);

Parameters

<index> : The index of an element with the data section

Last updated