global variable with numbering

i want to make some global variables using a for/next loop to create the name of this global

i want to count the records in a dataset and loop through them

so if there were 5 records in the dataset I want to create 5 global in the format
$count=count({dataset});

for ($x = 0; $x <= $count; $x++) {
[glo_color_].$s = {dataset[$x][0]};
}

code above is not working.

[global_1]
[global_2]
[global_3]
[global_4]
[global_5]

is this possible?

You can create a Global Array.

so i set a [global] = $arr
but how do I the first value of the global array? With a regular array the syntax is $arr[0]
[global][0] is not working

any suggestions?

$g_myvalues = array();
$g_myvalues[“a”] = ‘Value 1’;
$g_myvalues[“b”] = ‘Value 2’;

.
sc_set_global($g_myvalues);

okay, but do i recall the first and second value?

Yes. You can use it in all your apps.

In yours Apps you can do:

$my_globalvar = [g_myvalues][“a”];

for ($x = 0; $x <= $count; $x++) {
$SESSION["glo_color".$x]= {dataset[$x][0]};
}

For the fields the dataset
regularly is {address1} {address2}

You can use in the for

for ($x = 1; $x <= 2; $x++) {
$o=‘address’.$x.’_’;
echo 'Address ‘.$x.’ = '.$this->{$o};
}