Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

for loop comparison

Status
Not open for further replies.

copeZero

Programmer
Aug 31, 2007
46
0
0
CA
Hi all, and i have to say, thats to everyone who has educated me here!

I have an issue with comparing against a session name (not the value)

This is what i have:
Code:
if (listpc[index].PieColour != null && a1 < 1)
{
  foreach (string se in Session.Contents)
  {
   if (se != listpc[index].PieLabel)
   {
                                                   
   Response.Write("<slice title='" + listpc[index].PieLabel + "' color='" + listpc[index].PieColour + "'>" + listpc[index].PieSlice + "</slice>");

   a1 = 1;
   }
  }                                  
}

I can use a for loop this way cause it produces to many response.writes than required.

I basically need to skip the response.write if
(se == listpc[index].PieLabel)

Is there an "in" directive like
if (in Session.Contents != listpc[index].PieLabel)
response.write

???


Hope i made myself clear, Thanks
 
ahh i can do a direct comparison with if (session.contents != something)


and it references each item in the collection, fabulous!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top