This would best be handled with a do while loop.
Yes, you would have to enclose the code you want within the loop. while and do-while statements