|
-
April 30th, 2015, 12:41 PM
#1
Return a list of defines given a range.
Hi
I have a bunch of defines with values from 1-100.
I want to provide some sort of function that takes in a range and returns a list or map (like a python dictionary) of items that fall under that range
eg.
#define BOB_AGE 10 // this is how existing defines are and I cant change them.
#define BILL_AGE 13
#define TIM_AGE 22
#define TOM_AGE 30
getPeopleBetween(5,20);
I would want a python like dictionary that is returned, where I can have map like functionality and request the value (age) from this returned list.
At the moment, I have a master map list where I add all defines within the constructor. I was thinking of creating another list and returning that within the get function. However, would I not have scope problems?
Just thinking what would be a good solution.
Hope this makes sense.
Thanks all.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|