Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9. Iteration: Beyond the Basic P... > THE PERFORM WITH TEST AFTER OPTION

9.4. THE PERFORM WITH TEST AFTER OPTION

The type of iteration using a PERFORM UNTIL is similar to a DO WHILE in other languages. With this structure, a test for the condition is made first, even before the sequence of steps within the PERFORM is executed. If the condition is not met initially, then the instructions to be PERFORMed are executed at least once. If the condition is met initially, then the instructions to be PERFORMed are not executed at all.

Most languages also have an iteration structure that executes the instructions to be PERFORMed even before the test is made. This ensures that the sequence of steps to be performed is executed at least once. With versions of COBOL prior to COBOL 85, there was no convenient way of executing the instructions to be PERFORMed at least once before testing the condition.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint