I need help to cycle through a array its quite simple when working with index numbers but is there a simple way to cycle through a array with named values in a generic for loop without knowing the string names ?
void main()
{
int c;
if(c==NULL())
{
setglobalvar("test",array(3));
void x = getglobalvar("test");
set(x,"0","zero");
set(x,"1","one");
set(x,"2","two");
c=1;
}
if(isfirst(x)==0)
{
previous(x);
}else if(isfirst(x)==1)
{
settextobj(0, 35, 30, 3, 9999999999, value(x));
}
}
void main()
{
setglobalvar("test",array(3));
void x = getglobalvar("test");
set(x,"0","zero");
set(x,"1","one");
set(x,"2","two");
settextobj(0, 35, 30, 3, 9999999999, value(x));
}
void x;
if( getglobalvar("test") == NULL() )
{
setglobalvar("test",array(3));
x = getglobalvar("test");
set(x,"0","zero");
set(x,"1","one");
set(x,"2","two");
}
x = getglobalvar("test");
while(!isfirst(x)) previous(x); // or reset(x);
if(isfirst(x))
{
settextobj(0, 35, 30, 3, 9999999999, value(x));
}
free(getglobalvar("test"));
setglobalvar("test",NULL());
msmalik681 said:...The engine dumps any non freed array or images so why should i free them ?
msmalik681 said:I want to use my array over save games so at no point i would free or null the globalvar. The engine dumps any non freed array or images so why should i free them ?
not array but globalvar can retrieve another value.msmalik681 said:Ok so i noticed you used a free command and then set it to null. So when you free a array does it still hold the data ?
msmalik681 said:
Damon Caskey said:msmalik681 said:
The question is why? Bitwise math WAY over complicates a matter of simple variable storage and it's limited to scalar values. Just null and free when you're finished - the end. There's nothing dangerous about it.
DC
msmalik681 said: