Are you at any point in the loop setting ElaborazioneCompletata to False? If not, it will continue to be True for all iterations once it's been set to True.
Are you at any point in the loop setting ElaborazioneCompletata to False? If not, it will continue to be True for all iterations once it's been set to True.