two possible problems.
one. you may be destroying a time value in line 18. making prt[0] equal to prt[4] may cause a problem when you need the prt[0] time in line 28 and 32.
maybe you could store prt[0] before the diff loop in lines 16-20, then restore it afterward.
1 2 3 4 5 6 7 8
|
Time temp;
temp = prt[0]; // is this allowed?
while(prt[4].Equal(prt[0]) != true)
{
prt[0].incr();
diff.incr();
}
prt[0] = temp; // is this allowed?
| |
two. your earliest time may never be less than 0,0,0, so you always end up with a flogin of 0,0,0. start flogin with any of the input times.
change line 24 to something like:
it should sort itself out.
maybe three. does your diff loop work when prt[4] is earlier than prt[0]? i don't really understand how you calculate diff.
maybe four. i don't see any copy/assigning except for .set() in example1. are lines 30 and 34 allowed or do you have to copy over the time by the h,m,s?