Re: [OT] My First C# (warning - long post)



LX-i<lxi0007@xxxxxxxxxxxx> 02/01/07 7:51 AM >>>

Along those lines - is there a better way to search through an array
other than "for (int i = 0; i < array.length; i++)"?

I'm not sure specifically what you are referring to, but, if we assume the
above code is something like
string array[] = new string[10];
for (int i = 0; i < array.length; i++)
{
doSomething(array[i]);
}

You can replace it with

foreach (string s in array)
{
doSomething(s);
}

Is that what you're looking for?

http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingWithArrays111420050603
54AM/WorkingWithArrays.aspx

MF Net Express 5.0 has something similar for COBOL, which I'll post from
home.

Frank

---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
.



Relevant Pages

  • Re: When a default constructor necessary?
    ... The very reason I snipped your ... I wasn't referring to the FAQ as incorrect in this regard. ... When you want to create an array of objects of your class. ...
    (comp.lang.cpp)
  • Re: Collections of structured-data objects: what approach?
    ... connecting the dots might help others stumbling along this way, and you never know it might turn out that your "consistency" comment was referring to something else I didn't see. ... the reason is probably that Array and Hash are so powerful on the one hand and that requirements are so different on the other hand. ...
    (comp.lang.ruby)
  • Re: <ctype.h> toLower()
    ... >> industry when you don't even know what an array is. ... No I am referring to the fact that you thought that if you allocated memory ... > It is not uncommon for people to resort to attempts at ad hominem attacks ... of a bunch of little mosquitos trying to attack me from a bunch of different ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Gaussian statics law
    ... "Terman was referring to close spaced of the parasitic form, ... and he also mentions the Yagi array. ... he wrote the comments on page 185 in "Antennas". ... If you are implying that Richard is incorrect in his statements and that Art has even a tiny clue about reality, ...
    (rec.radio.amateur.antenna)
  • Re: Gaussian statics law
    ... no more energy than it emitted or conducted away. ... "Terman was referring to close spaced of the parasitic form, ... But, Kraus, whose invention, the W8JK array, has two dipole elements ... he wrote the comments on page 185 in "Antennas". ...
    (rec.radio.amateur.antenna)