Results found for: loop
Printer Print This Page
Image Friendly
techweb
loop
techweb
In programming, a repetition within a program. Whenever a process must be repeated, a loop is set up to handle it. A program has a main loop and a series of minor loops, which are nested within the main loop. Learning how to set up loops is what programming technique is all about.

The following example prints an invoice. The main loop reads the order record and prints the invoice until there are no more orders to read. After printing date and name and addresses, the program prints a variable number of line items. The code that prints the line items is contained in a loop and repeated as many times as required.





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 is a GOTO that points back to the beginning. In assembly language, the programmer writes the GOTO, as in the following example that counts to 10.

          MOVE     "0" TO COUNTER
   LOOP   ADD      "1" TO COUNTER
          COMPARE  COUNTER TO "10"
          GOTO     LOOP IF UNEQUAL
          STOP


In high-level languages, the GOTO is generated by the interpreter or compiler; for example, the same routine as above using a WHILE loop.

       COUNTER = 0
       DO WHILE COUNTER <> 10
          COUNTER = COUNTER + 1
       ENDDO
       STOP


For a more detailed look at a loop, look at the end of the C definition. The main event loop of the DOS version of this database is presented.



Search For loop On ChannelWeb

Find the latest news and information on loop from across the Channelweb Network of IT Web sites.


techweb
temrs similiar to your header
Entries before loop
techweb
techweb look and feel
techweb lookaside cache
techweb lookup
techweb lookup table
techweb Loongson
techweb Entries after loop
techweb
techweb loop back
techweb loop carrier
techweb loop plant
techweb loop sharing
techweb loop start
techweb
define another it term
techweb

Or get a random definition
techweb
copyright THIS COPYRIGHTED DEFINITION IS FOR PERSONAL USE ONLY.
All other reproduction is strictly prohibited without permission from the publisher.

Copyright (©) 1981-2005 The Computer Language Company
Inc All rights reserved.








CHANNEL SERVICES >>