Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-25-2003, 07:44 PM   PM User | #1
sweenster
Regular Coder

 
Join Date: Sep 2002
Location: Scotland
Posts: 407
Thanks: 0
Thanked 0 Times in 0 Posts
sweenster is an unknown quantity at this point
arrays and things...

i have this:

Code:
      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:
Code:
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??
__________________
My body's a temple... and like those ancient Greek ones it's a ruin
sweenster.co.uk
sweenster is offline   Reply With Quote
Old 04-25-2003, 08:04 PM   PM User | #2
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,234
Thanks: 4
Thanked 81 Times in 80 Posts
Spookster will become famous soon enough
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]));

??



PHP Code:

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

__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 04-25-2003, 09:03 PM   PM User | #3
sweenster
Regular Coder

 
Join Date: Sep 2002
Location: Scotland
Posts: 407
Thanks: 0
Thanked 0 Times in 0 Posts
sweenster is an unknown quantity at this point
__________________
My body's a temple... and like those ancient Greek ones it's a ruin
sweenster.co.uk
sweenster is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:19 AM.


Advertisement
Log in to turn off these ads.