Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

BASIC Programming/Beginning BASIC/Control Structures/DO...LOOP

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

In the last chapter we learned about inputing data to the program. Well now you'll be learning how to repeat a function over and over again. Remember anything to the right of an apostrophe (') are comments in one version of BASIC, and should be removed, or replaced with a different kind of REMARK, if they cause problems. CLS 'Clears screen for user DO 'Starts the Looping process, anything between this and the LOOP command will be repeated. PRINT "You will get this message over and over." 'Displays the message "You will get this message over and over." LOOP ' Shows where objects should stop being looped. This loop will continue forever, unless interrupted by the operating system. If you wanted to have a condition where the loop ends, you can put a WHILE or UNTIL keyword after LOOP.