setting areas of script

Is there a way to anchor an area. What i mean is


stage 1:
getInfo()
set flag to checkList()
if flag equals true then go back to stage 1
printDetails()

Any ideas, as its eaither this or trying to do this


getInfo()
set flag to checkList()
if flag equals true then 
getInfo()
set flag to checkList()
if flag equals true then 
getInfo()
set flag to checkList()
if flag equals true then 
getInfo()
set flag to checkList()
if flag equals true then 
getInfo()
set flag to checkList()
end all if

as you can see this could cause problems as there might be infinite errors but cant do that many If statements, whereas the above can work with how ever many errors.

The good old repeat loop comes to mind.


repeat
getInfo()
set flag to checkList()
if flag is not equal to true then exit repeat
end repeat
printDetails()

I suppose I should have given this a go before posting, so I hope it works.

Kevin

or even easier…

set flag to false
repeat until flag is true
   set flag to checkLoop()
end repeat

Just make sure checkLoop() will return true at some point.