Home » Community » Newbie corner » Accessing Index structure elements
Accessing Index structure elements [message #49173] |
Sun, 31 December 2017 13:55 |
kr8vzn
Messages: 4 Registered: May 2013 Location: Australia
|
Junior Member |
|
|
Hi,
I have the structure as follows.....
struct AccountList : Moveable<AccountList>
{
String name;
Date begin;
Date end;
unsigned GetHashValue() const { return CombineHash(name); }
bool operator==(const AccountList& b) const { return name == b.name; }
AccountList(String name, Date begin, Date end) : name(name), begin(begin), end(end) {}
AccountList(String name) : name(name), begin(GetSysDate()), end(Date(1900,1,1)) {}
AccountList() {}
String ToString() const { return String() << name << ' ' << begin << ' ' << end; }
};
Then in the main function i have.....
Index<AccountList> accounts;
int account_index;
later on i have a loop that reads input and should update the account list and date range.
I am stuck on how to do this. Can you help?
account_index = accounts.FindAdd(AccountList(ce.account));
accounts.Set(account_index,******)
******
I want to be able to set the account to the same name as that found from the FindAdd
but with the date begin and end compared to another date and changed as follows
if (begin>date) begin = date
if (end<date) end = date
Regards
Craig
|
|
|
Goto Forum:
Current Time: Wed Apr 24 15:29:58 CEST 2024
Total time taken to generate the page: 0.78694 seconds
|