@PeterClemmensen
Thanks for all the explantions. But I'm not sure if I understand it correctly:
So if the data is read sequentially it means in the first line:
/* 4 */
if h.check(key : Account); /* if current account 40 is in the account_old_key of h -> yes */
/* 5 */
do until (rc); /* If rc is a success it's 0. So I guess in this case this means 'Do until rc = 0' */
rc = hh.find(key : Account_old); /* Is Account_old(=38) in the Account_key -> no */
Account_old = Account_oldest; /* Account_old = 2008 */
end;
How will this become a loop, as there is only one Account_old to the just read Account?
Or will it loop over all possible Account_olds? I'm a bit confused by "data is read sequnetially".
The first time the rc is a sucess is when Account is 41 and Account_old is 40. And there Account_old is set to 2008.
In the end this will lead to the desired Account 44 and Open_old 2008, but only because Account_old 38 shows up first in the list and has the oldest date. If Account_old 39 would start in 2007, the final result would still be Account 44 and Open_old 2008, right?
And how come the ouput is only the desired Account 44 and 45? Which never enter the if or the do?
Puh, this hash-thing is quite confusing for me...
... View more