CASE STUDY^569
else
{
secondEntry = secondList.getNextItem();
secondCount++;
}
}
else // Duplicates
{
resultList.insert(firstEntry);
if(firstCount == firstLimit)
moreData1 = false;
else
{
firstEntry = firstList.getNextItem();
firstCount++;
}
if(secondCount == secondLimit)
moreData2 = false;
else
{
secondEntry = secondList.getNextItem();
secondCount++;
}
}
}
// Loops to add remaining entries to combined list
if(moreData1)
while(firstCount <= firstLimit)
{
resultList.insert(firstEntry);
firstCount++;
if(firstCount <= firstLimit)
firstEntry = firstList.getNextItem();
}
else if(moreData2)
while(secondCount <= secondLimit)
{
resultList.insert(secondEntry);
secondCount++;
if(secondCount <= secondLimit)
secondEntry = secondList.getNextItem();
}
// Print labels and write combined file
resultList.resetList();
resultLimit = resultList.length();
for(intcounter = 1 ; counter <= resultLimit; counter++)