HISTORY_LIMIT
if (fCurrentHistoryIndex == HISTORY_LIMIT - 1)
while (items.CountItems() >= HISTORY_LIMIT)