Alan Freedman -- The Computer Language Company - Computer Desktop Encyclopedia
Computer Desktop Encyclopedia
Longest-Running Tech Reference on the Planet

A CDE Definition

You'll love The Computer Desktop Encyclopedia (CDE) for Tech Term of the Day (TTOD)

LOOK UP ANOTHER TERM


loop

A repeating sequence in a program. Most software programs have a main loop and a series of minor loops nested within. Learning how to set up loops is fundamental programming logic. For a detailed look at an actual loop, see event loop.

Loops are accomplished by various programming structures that have a beginning, body and end. The beginning generally tests the condition that keeps the loop going. The body comprises the repeating statements, and the end points back to the beginning. In assembly language, the programmer writes a GOTO instruction as in the following pseudocode example that counts to 10. See pseudocode.


            move     "0" to EventCounter
 EventLoop  add      "1" to EventCounter
            compare  EventCounter to "10"
            goto     EventLoop if unequal
            stop


In a high-level language, the pointer back to the beginning is generated by the interpreter or compiler as in this pseudocode example, which uses a WHILE loop. See pseudocode and do loop.


   EventCounter = 0
   do while EventCounter not equal to 10
      EventCounter = EventCounter + 1
   enddo
   stop





Batch Print the Invoices
This batch processing example reads order records and prints invoices. After printing date and bill-to/ship-to addresses, the program prints a variable number of line items. The line item loop is repeated as many times as required.






Personal Use Only

Before/After Your Search Term
BeforeAfter
LonWorksloop back
look & feelloop carrier
look-ahead cacheloop plant
look and feelloop sharing
look uploop start
lookaside cacheloopback
lookuploopback address
lookup tableloopback IP address
Loonloopback plug
LoongsonLoopPay

Terms By Topic
Click any of the following categories for a list of fundamental terms.
Computer Words You Gotta KnowSystem design
Job categoriesUnix/Linux
Interesting stuffPersonal computers
InternetIndustrial Automation/Process Control
Communications & networkingAssociations/Standards organizations
HistoryDesktop publishing
Audio/VideoGraphics
MainframesSecurity
ProgrammingHealthcare IT
System design