AnsweredAssumed Answered

Better looping structure?

Question asked by ghoffman on Nov 25, 2011
Latest reply on Nov 25, 2011 by RayCologon

Following programming practices of experts, I've built several solutions that included scripts with looping structures similar to this:

 

Setup steps (Go to layout, Freeze Window, etc.)

Perform Find

Go to Record/Request/Page [First]

Do some operations

Loop

Go to Record/Request/Page [Next; Exit after Last]

Do some operations

End Loop

 

Sometimes the operations line will be many lines long and has to be repeated inside the loop.

 

However, I have recently begun to use a different structure, as follows:

 

Setup steps

Perform Find

Go to Record/Request/Page [First]

Loop

Do some operations

Go to Record/Request/Page [Next; Exit after Last]

End Loop

 

Using this structure, if I have to change the operations lines, I don't have to do it in two places.

 

So I ask you, is there something inherently wrong with this second structure? If not, why do the experts continue to use the first?

 

Just askin'

 

Gary

Outcomes