For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 of the data section is to store static information and its size is determined by the values within it. The static values can be accessed in a GPC script through the use of an indexer. You can use definitions in a data section as well if you like, as shown in the example below:

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 = duint8(3);    //a will have a value of 255
    b = dint8(3);     //b will have a value of -1
    c = dint16(3);    //c will have a value of 511
}

Functions

The values placed within the data section are expressed in bytes (8 bit 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.

You may put in a larger number into the data section as well, however they will cause the values coming after it to have an index of +1 for 16 bit ranged values and +3 for 32 bit ranged values. A warning will be shown when you do this.

There are multiple functions to retrieve data of different ranges, the below table explains each of the functions. They all have the same syntax:

Function Name
Minimum Value
Maximum Value
Bytes Read

dint8

-128

127

1

duint8

0

255

1

dint16

-32,768

32,767

2

duint16

0

65,535

2

dint32

-2,147,483,648

2,147,483,647

4

Last updated