...

View Full Version : arrays and things...



sweenster
04-25-2003, 08:44 PM
i have this:



while (idx<100)
{
Get5017H(3,i,&(val0[idx]));
Get5017H(3,i,&(val1[idx]));
Get5017H(3,i,&(val2[idx]));
Get5017H(3,i,&(val3[idx]));
Get5017H(3,i,&(val4[idx]));
Get5017H(3,i,&(val5[idx]));
Get5017H(3,i,&(val6[idx]));
Get5017H(3,i,&(val7[idx]));
idx++;
}

but i'd like to run it with a for loop something like:


while(idx<100)
{
for(k=0;k<8;k++)
{
Get5017H(3,i,&(val[k][idx]));
}
}

it's the [k][idx] thing i'm not sure about. I'm pretty sure the above wont work. Any suggestions??

Spookster
04-25-2003, 09:04 PM
I assume then your ultimate goal is to loop through the values like so:

Get5017H(3,i,&(val0[0]));
Get5017H(3,i,&(val1[0]));
Get5017H(3,i,&(val2[0]));
Get5017H(3,i,&(val3[0]));
Get5017H(3,i,&(val4[0]));
Get5017H(3,i,&(val5[0]));
Get5017H(3,i,&(val6[0]));
Get5017H(3,i,&(val7[0]));

Get5017H(3,i,&(val0[1]));
Get5017H(3,i,&(val1[1]));
Get5017H(3,i,&(val2[1]));
Get5017H(3,i,&(val3[1]));
Get5017H(3,i,&(val4[1]));
Get5017H(3,i,&(val5[1]));
Get5017H(3,i,&(val6[1]));
Get5017H(3,i,&(val7[1]));

Get5017H(3,i,&(val0[2]));
Get5017H(3,i,&(val1[2]));
Get5017H(3,i,&(val2[2]));
Get5017H(3,i,&(val3[2]));
Get5017H(3,i,&(val4[2]));
Get5017H(3,i,&(val5[2]));
Get5017H(3,i,&(val6[2]));
Get5017H(3,i,&(val7[2]));

??






$idx = 0;
while($idx<100){
for($k=0;$k<8;$k++){
$arrayName = "val" . $k . "[" . $idx . "]";
Get5017H(3,i,&($arrayName));
}
$idx++;
}

sweenster
04-25-2003, 10:03 PM
:thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum