× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Okay, for some reason I can't remember how to do this. I need to count the
number of people for each age that work within the company (for demographics
stuff). The problem is that I forgot how to deal with multiple arrays.

The way I am doing this (...and I am open to better ways) is to create a
multi-column array that holds the age and the count. When I process an
employee, I will lookup to see if the age is in the array. If it is, I add 1
to my counter. If not, I add the age in to my array. But, I would like it in
numeric order so when I go to print it out, it is in age order.

I guess what I would like to know what the best approach to this would be. I
haven't dealt with arrays for a while again. Is my idea a good approach for
this? How do I create a 2-column array? Example:

Ages    AgeCount
21      5
35      6
18      1
20      10
45      50

Thanks for any help given....

Mike Wills


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.