Obviously this is incomplete code as ive only posted the relevant parts.
Im not even sure if the brackets line up in the code just pasted.
But anyway is there any other way instead of using the bools to guarantee that the statements are only executed once ?
Such as
Sorry i think you misunderstood.
I understand i can use different data types.
I was asking if there was anyway to tell a statement to only execute once inside the loop without the use of a variable.
Maybe a switch? Otherwise I do not think so if you are looping other stuff and only that function once but if you are only trying to run the loop once you shouldn't use a loop or just a break I guess.
***Looks like there is a function mentioned by JLBorges***