Here, there would be no iteration of the loop if the condition fails for the first time. The "Do" and "Do While" statements execute a loop based on a condition being true or false. again the loop runs when it reaches wend statement. Wend loop in VBScript is −. beginning like the While-Wend. wap to display the first 10 terms of the series 3,6,12,24 using for-next and while-wend loop in qbasic. The Do While Loop. For example: Sub While_Loop_Example Dim LCounter As Integer LCounter = 1 While LCounter < 10 MsgBox (LCounter) LCounter = LCounter + 1 Wend End Sub. Run() is called. Once the condition isn't met (becomes False), VBA exits the loop. You can do this using a while loop. Assignment 3 - For loops and while loops. 2 (Player$(), NumGames, count) LOOP UNTIL more = 0 Extro COLOR 7: CLS ' Else QBasic crashes here! lol DEF SEG = 0 ' Restore NumLock state POKE. This example uses the WhileWend statement to increment a counter variable. An example of using the While…Wend loop is the WhileReadLineWend. For example, consider this QBASIC program. Code Download. A while loop will loop continuously, and infinitely, until the expression inside the parenthesis, becomes false. Here's the structure of a Do While Loop:. Code - Command statements which will be executed dependant upon the evaluation of the condition. Qbasic Exercise 6 - Loop Structures. While Counter < 20 ' Test value of Counter. x is set to zero, while x is less than 10 it calls cout<< x < 0. WEND statement? To execute a function of statements in a loop as long as a given condition is true. They can be used to carry out a specific task in an iterative manner till such time that a condition is met (or the VBA loop is terminated). Loops Loop with condition on the beginning: while, while end while, do while loop, while do, while wend Condition testing is done at the beginning of the loop. Simply put, the term describes someone who communicates through their cello, using amplification, loops and effects pedals to create original musical compositions that literally speak a new language. Maxey) DISCLAIMER /TERMS OF USE The information, illustrations and code contained in my "Microsoft Word Tips" are provided free and without risk or obligation. Don't think I am leaving these other two loops for later because they are harder than the 'while' loop. Select While ActiveCell <> "" If parent = ActiveCell. For this example i will make the algorithm sort the numbers stored in an array into ascending order, it can be used for other things but you would need to change the sort criteria. 51 QBASIC Programming Without Stress §4. Learn to use VBScript code to change web pages on the fly, check data before it's sent to the server, or perform calculations behind the scenes. Qbasic sequential file handling that asks a post of the employee and displays his/her records from the sequential data file "XYZ. What happens when no step value is specified in a FOR statement? 4. There are 4 types of loop in Visual Basic for Applications - this blog shows how and when to use each type of VBA loop structure. While condition(s) [statements 1] [statements 2] [statements n] Wend Flow Diagram Example Private Sub Constant_demo_Click() Dim Counter : Counter = 10 While Counter < 15 ' Test value of Counter. If there is not a condition to end the loop, the computer will be sent through an infinite loop. 1) Assignment Statement: LET 2) Input Statement: READ , INPUT 3) Output Statement: PRINT 4) Conditional Statement: IF-THEN-ELSE 5) Loop Statement: FOR-NEXT, WHILE-WEND, DO LOOP, GOTO : QBASIC STATEMENTSEach instruction in QBASIC is called a STATEMENT. LOOP when you want to loop until a condition is true, or the very similar DO WHILE LOOP or WHILE WEND when you want to loop while a condition is true. Print I ' 16 End. In this we will have to specify the increment number. For Loop For… Each Loop While … wend Loop Do … while Loop Do… until Loop In this chapter you will learn about For Loop, Steps in For Loop, Exit from for loop, For…. Search for: OfficeTutes. These while loops will calculate the Factorial of a number. Some of the other problems don’t really seem like problems to me. Command Timings. while loops The do. The while loop reads a line inside the file. Do-While Loop When Condition is checked before the loop starts. Next, we’ve assigned i the value of 3. If the condition is True, the loop is executed until the program finds Wend and then jumps back to the While statement. Wend loop in VBScript is − While condition(s) [statements 1] [statements 2]. You can check the condition before you enter the loop (as shown in the following ChkFirstWhile example), or you can check it after the loop has run at least once (as shown in the ChkLastWhile example). Another great tool in your coding tool belt is loops. WHILEWEND: The WHILEWEND loop executes a set of instructions as long as a given condition is true. h is a header file which is included using the preprocessing directive #include. 5 The While…. If you do not know the number of times you need to execute a block of code, then you will be using Do While loops. While constructing nested loops, it is necessary to have the same type of looping structure. In the above example, the value of n is 2 in the loop, which is false according to the condition but the loop is continued until the condition is checked. The code contain a loop: Range("c2"). In our example While – Wend will print the value of X till X has reached the value 11. WHILE {code} WEND While a condition is true, the code part inside the loop will run until the condition is false. DO WHILE loop; Looping through table records; WHILE LOOP. An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. FreeBASIC can be seen to extend the capabilities of Microsoft QuickBASIC in a number of ways, supporting more data types, language constructs, programming styles, and modern platforms and APIs. It's a lot more fun to create your own games to play on the computer. Language cross-reference @While function in formula language @For function in formula language. As an example, the following program writes out all the numbers from 1 to 10: (Note that you can click here to download a copy of this program. While it costs the same number of characters as an unconditional GOTO, it's a little more intuitive to read. Print "This is loop number "& intCounter If intCounter >= 5 Then intTest = 0 End If intCounter = intCounter + 1 Loop End Sub. My_Number = Val(str_My_Number) i = 0 While i > My_Number i = i + 1 Wend Print "I think that your number is "; i In this example, the loop begins with While and ends with Wend. But using a Do While loop inside of a For Each statement, you can achieve the same functionality. Case = wdTitleWord. This does not have any special features other than what is explained with Do While. I am trying to use a nested While/Wend loop with ExitLoops for each loop. for each file in folder. If so, the program again executes the statements between Do and Loop While else exits the Loop. It seems that the VBA structure allows an additional iteration that the LISP While does not. For its time, QBasic provided a state-of-the-art IDE, including a debugger with features such as on-the-fly expression evaluation and code modification. 1) can end the infinite loop. Hi Benoit, we have gb. Extreme Excel Group has already carved a place for itself in the VBA Training sector in Delhi/ Gurgaon region and also offer online trainings across the globe. Until/While loop. In VBA, loops allow you to go through a set of objects/values and analyze it one by one. The leather knee patches are made with the quality-tested ALOS leather for longer durability. A While Loop is a simple loop that keeps looping while something is true. 5 The While…. The DO UNTIL statement evaluates the condition at the bottom of the loop; the DO WHILE statement evaluates the condition at the top of the loop. It can be obtained up to any term. VBScript Do While Loop. To create an infinite loop, you can use a non-zero number as the expression. Unlike the DoLoop statement, you cannot cancel a WhileWend loop with Exit. The loops are the While, Do Loop, and For loop. Exiting Loop. (Qbasic Code) Using WHILE WEND. Support this group and join the ads-free movement to make online forums a better place. The first (which you should have learned) is a control statement. Use a WhileEnd While structure when you want to repeat a set of statements an indefinite number of times, as long as a condition remains True. The statements in the loop are executed as long as the condition evaluates to True. A DOLOOP can use the same DO WHILE condition to get the same results. The most important distinction between the two loops is that the Do Until Loop arrays executes at least once. That loop hasn't run out yet, so line 3 gets executed. The Do While Loop. The example below was written to copy pictures that are made with a webcam to a web directory. They are return, goto, break and continue. The for loop executes the commands placed between the do and done statements until all values in the value list passed to it have been processed. The THEN part and the ELSE part, if any, can contain one or more IF-THEN-ELSE-END IF statement in one of the three forms. If the expression returns TRUE, the sequence of statements is executed, then control resumes at the top of the loop. Otherwise, it will loop forever, and the outer loop will never have a chance to complete. This post will guide you how to use loops statements in MS excel VBA. Using QBasic Help: To get help on a Basic keyword, place the cursor on it and press F1 or click the right mouse button. Number = Number + 1. Description: Indicates the end of a do. In plain English this loop says "For each worksheet find the used range and then loop through the used range to perform a task on each cell in the used range. Sometimes, using CTRL BREAK (QBasic 1. For Loop For… Each Loop While … wend Loop Do … while Loop Do… until Loop In this chapter you will learn about For Loop, Steps in For Loop, Exit from for loop, For…. The While loop stops when i is equal to My_Number. In the example below, we're halving a number until the result is greater than 1. executed at least once? a. Do While A > 10 ' loop body Loop While A > 10 ' loop body Wend Programming Example: Sorting With Embedded Loops There are many ways to use loops, for example, to search lists, return values, or execute complex mathematical tasks. For example: for (i = 1 ; i10 ; i++) {. There are 3 type of loops in C++ Programming:. It was initially developed by Mercury Interactive and then acquired by HP. If the condition is False, the program continues directly following the Wend statement. loop block, a section of code that will execute continuously, or. WHILE Loop. Here, I am only doing of tenth term. 1 FOR-NEXT loop This is the simplest and ‘mostly used. The WHILE loop, also called a conditional loop, evaluates a condition before each loop executes, and if false, the loop is terminated. Looping in VBA Macros. Hi, i am creating a bot and i get stucked in one point of developing a bot. This program shows a while-loop. Looping in VBA Macros - an introduction to the 4 types of loop (this blog) Looping a set number of times or iterations (FOR … NEXT) Looping with conditions (DO UNTIL / WHILE LOOP) Looping over collections (FOR. Gibson - 08182843672 21 WEND Example DIM X AS INTEGER CLS x=1 WHILE X < 10 PRINT X X = X +1 WEND The above program will print all positive integers within the stated range. The While loop stops when i is equal to My_Number. 12 SELECT CASE. While condition(s) [statements 1] [statements 2]. org/w/index. SUB reads header contents of a BSAVE file that may include embedded RGB color settings before the image. To set an infinite while loop use: true command - do nothing, successfully (always returns exit code 0) false command - do nothing, unsuccessfully (always returns exit code 1). While condexpr: Do statements while condexpr is True. Example in VBA Code. series = InputBox("Enter number of series") a = 1. Decha Boonliang author of Nested Loops (Nested for , Nested While, Nested do-while) is from Bangkok, Thailand. Living in the shadow of the beloved for loop are the while and dowhile loop variants. Statements. # For this code, make sure to have a line that says # "import math" at the top of your program. o DOLOOP provides a better way to execute statements in a program loop. While statements will be executed as long as condition is True. Just came across this recently. for each file in folder. Best Answer: Since you are not allowed to use a FOR/NEXT loop your choices in qbasic are limited to the WHILE/WEND or the DO/LOOP loop statments. Really really basic BASIC. Wend is an older looping syntax and Do. Creating loops. CHECK ENTERED NUMBER IS UPPERCASE OR LOWERCASE in QBASIC, check a given number is palindrome or not in qbasic, check a given string is palindrome or not in qbasic, check given number is armstrong or not in qbasic, reverse a given number in qbasic, Program to convert decimal to hexadecimal in qbasic, Program to convert decimal to octal in qbasic, Program to reverse a given string in qbasic. This tutorial will show the While loop. For example: Sub While_Loop_Example Dim LTotal As Integer LTotal = 1 While LTotal < 5 MsgBox (LTotal) LTotal = LTotal + 1 Wend End Sub. Wend is an older looping syntax and Do. Wend Loop is very similar to the Do Loop. For example, suppose that marks is an int array of 5 elements, then the 5 elements are: marks [0], marks [1], marks [2], marks [3], and marks [4]. 0 (VB6) programming in your own. Difference between while(1) and while(0) in C language Prerequisite: while loop in C/C++ In most computer programming languages, a while loop is a control flow statement that allows code to be executed repeatedly based on a given boolean condition. Do nothing loops, loops that simply count to a number then exit. With the Break command it is possible to exit the While: Wend loop during any iteration, with the Continue command the end of the current iteration may be skipped. However, both for and while are entry controlled loops. The While loop stops when i is equal to My_Number. CHECK ENTERED NUMBER IS UPPERCASE OR LOWERCASE in QBASIC, check a given number is palindrome or not in qbasic, check a given string is palindrome or not in qbasic, check given number is armstrong or not in qbasic, reverse a given number in qbasic, Program to convert decimal to hexadecimal in qbasic, Program to convert decimal to octal in qbasic, Program to reverse a given string in qbasic. Then we enter “orksheet” into the input form (itm. Using QBasic Help: To get help on a Basic keyword, place the cursor on it and press F1 or click the right mouse button. A loop can be executed either while the condition is True or until the condition becomes True. Microsoft recommends that you use the Do loops as they are more structured. Another great tool in your coding tool belt is loops. Then control transfers to the statement following the WEND. While Number < 1000. LotusScript tests condition before entering the loop and before each subsequent repetition. For example,. Using the continue causes the loop to skip tto the end of the current iteration (i. Those were simple examples but while loops are much more general! In the interactive loop we have seen a continuation condition with a string test, and getting ready for the next time through. Developers from all over the world come together to share knowledge, source code, and tutorials for free to help their fellow programmers - Professional Developers, Hobbyists and Students alike. In most imperative computer programming languages, a for loop is a control structure which allows code to be executed iteratively. Do nothing loops, loops that simply count to a number then exit. In For-Next loop always increment by one by default. There are three most useful Loops statements as bellows: For …Next loop, Do … Loop and While …Wend loop. WriteLine(number) number = number / 2 EndWhile. You'll find the latest qbasic news, source code, qbasic tutorials, forums, and much more. Unlike the Do WhileLoop and WhileWend repetition. 1 Introduction. Yes, I am talking about how to clear the keyboard buffer, so that, as soon as I lift my finger from the key, the buffer is clear, and, in the case of a moving sprite, it immediately stops. The entire course content and videos are created by Kamal Girdher who is popular on youtube by the name Extreme Excel (xtremeExcel). Next, we’ve assigned i the value of 3. Maxey) DISCLAIMER /TERMS OF USE The information, illustrations and code contained in my "Microsoft Word Tips" are provided free and without risk or obligation. WEND statement? To execute a function of statements in a loop as long as a given condition is true. hercules 4 hercules graphics 4 icon 4 images 4 install 4 install program 4 monochrome 4 puzzle 4. A While/Wend loop can only be exited prematurely with a GOTO or by exiting from an outer block (Exit sub/function or another exitable loop) Change to a Do loop instead: Do While True count = count + 1 If count = 10 Then Exit Do End If Loop Or for looping a set number of times: for count = 1 to 10 msgbox count next. In this blog post we will be discussing the Do. Hello Friends !! This Video is all about While Loop In Qbasic. This distinguishes it from the Repeat command. Best VBA Macro Training in Marathahalli - Bangalore, Book Free Demo - we offer real time training on VBA Macro with Hands on experience and project support, Our VBA Macro Trainers are working Professionals with 8+ years of experience. In the Basic IDE, in some cases, there is no way to stop a macro in an infinite loop except by killing the whole soffice. There are also loops that repeat statements a specific number of times. For example, you want to output the message "Welcome" while the value of the variable x is less than 5. Then, the formula c=a+b, a=b, b=c will trigger and will display the sequence in the picturebox with 2 spaces. Example of “Do While… Loop” Do While Expression ‘ Inserted code runs as long as the. The THEN part and the ELSE part, if any, can contain one or more IF-THEN-ELSE-END IF statement in one of the three forms. From MSDN: "The Do…Loop statement provides a more structured and flexible way to perform looping. Go to the next worksheet". The output is shown in Figure 15. Using loops-FOR…NEXT & WHILE…WEND Fibonacci series is the series in which the next number is obtained by the sum of two number just front of it. value = “orksheet”), move the cursor into the input form (itm. They exist because BASIC had two types of loops: 'DoLoop' loops which allowed 'Until' and 'While' end coditions in the head and the tail of the block and a way to exit the loop and the 'WhileWend' loop which supported. To terminate a loop, we will need to evaluate conditions, for example, whether a variable is equal to a value or not. Reply Delete. WHILE Loop. "Do While… Loop" • A "Do While" loop statement runs while a logical expression is true. while datetime. What is the function and syntax of WHILE …. body of loop. Using loops-FOR…NEXT & WHILE…WEND Fibonacci series is the series in which the next number is obtained by the sum of two number just front of it. While loops keep looping while the condition they test remains true, so you use a While loop if you have a condition that will become false when you want to stop looping. The main purpose of the While… Wend VBA loop is to execute certain statements as long as a particular condition is True. While loop 'while' statement just takes the stop condition. Loops Loop with condition on the beginning: while, while end while, do while loop, while do, while wend Condition testing is done at the beginning of the loop. That loop hasn't run out yet, so line 3 gets executed. First while entering. The loop in this example uses a for loop to collect the car names from the cars array:. wap to print all odd number from 1 to 100 cls a=1 b=1 do while b<=50 print a a=a+2 b=b+1 loop end wap to print all even numbers from 1 to 100 cls a=2. But I could not find a VBA statement to accomplish my goal. LOOP when you want to loop until a condition is true, or the very similar DO WHILE LOOP or WHILE WEND when you want to loop while a condition is true. 25s (QBasic 1. Qbasic Programming Notes - Sections 11 - 14. The syntax of a While. For example: Sub While_Loop_Example Dim LTotal As Integer LTotal = 1 While LTotal < 5 MsgBox (LTotal) LTotal = LTotal + 1 Wend End Sub. Description. Difference between for and while loop is that usually for is used when number of iteration are known in advance, whereas while is used when number of iterations are not known beforehand. If you can master these variatons and recognize when they are needed, then programming will become much easier. But for your given example that wouldn't be a really good practice. Print i Loop While False Next Here is another example…. This type of loop runs until the statement at the beginning resolves to FALSE. But using a Do While loop inside of a For Each statement, you can achieve the same functionality. This is useful if the code needs to be run at least once. You can declare variables using the Dim statement within the loop. Loops in the VBScript means those statements in the code which can be repeated several times until any particular condition reaches to an end. Sometimes you want everything in the program to stop while a given condition is true. Example 25: An Infinite WHILE / WEND Loop The above example shows an infinite loop. LOOP OVER THE VALUES n = 1,2,3,4 MOVE TO TYRE n MEASURE PRESSURE IN TYRE n GO TO START OF LOOP In Basic, the commands to start the above loop is For n = 1 To 4 and the command at the end is Next n. I know how to declare a variable and use a while loop in java. For example: For i = 0 To 10 Do If i = 4 Then Exit Do Rhino. Save filename, "my-8bit" The entire system hangs and you must manually remove PICO-8 from the tasklist. Maxey) DISCLAIMER /TERMS OF USE The information, illustrations and code contained in my "Microsoft Word Tips" are provided free and without risk or obligation. Now you understand why loops can be useful. Types of loops When you are programming with loops, it helps to understand that there are only a few basic formats that are used repeatedly. A classic example of this is rocket example. Wend loop in VBA. Wend definition is - to direct one's course : travel. qbasic programs for see – set 1 (function and sub ) Subas Paudel October 25, 2016 MODULAR PROGRAMMING , QBASIC PROGRAMS FOR SEE (SUB AND FUNCTION) No Comments Share on Facebook Share. Loop is preferred over this. SCREEN _NEWIMAGE (320, 200, 32). ) create a program that accepts 5 integers. The WHILE loop, also called a conditional loop, evaluates a condition before each loop executes, and if false, the loop is terminated. Example of "Do While… Loop" Do While Expression ' Inserted code runs as long as the. In For-Next loop always increment by one by default. The while-keyword is followed by an expression. Description: condition is a numeric expression used to determine if the loop will execute. IF THEN ELSE STATEMENTS in QBasic, FOR NEXT in QBasic, WHILE WEND in QBasic, DO LOOP STATEMENTS QBasic EXAMPLES QBasic FOR NEXT in QBasic,. here is a solution to produce a Do While Loop in DOS Batch: @REM initialize test value to be true @SET intCounter=1 :while @REM test condition @IF %intCounter% GTR 10 (GOTO wend) @REM procedure where condition is true @echo %intCounter% @REM s. Loop In this example the condition is "mynumber<10" and the instructions defines a response text and an increment of the variable "mynumber". QBasic Tutorial- for Dummies. If the loop is very lengthy, you can move the code for the loop to a separate Thread, allowing it to execute in the background. While it costs the same number of characters as an unconditional GOTO, it's a little more intuitive to read. Basic - Loop with condition on the beginning: do while loop, while wend Condition testing is done at the beginning of the loop. Wend loop, if the condition is True, all statements are executed until Wend keyword is encountered. statements will execute repeatedly while condition is a non-zero value. An example of using the While…Wend loop is the WhileReadLineWend. 0 -Struktur loop memperbolehkan anda untuk melaksanakan sekelompok baris lebih dari satu kali. It is another loop like 'for' loop in C. • This means that as long as your expression stays true, your program will keep on running. condition mentioned in the WHILE…WEND block. The DO UNTIL statement evaluates the condition at the bottom of the loop; the DO WHILE statement evaluates the condition at the top of the loop. jsi int main(){ int n, count, sum=0;. Note: The statements in a DO UNTIL loop always execute at least one time, whereas the statements in a DO WHILE loop do not iterate even once if the condition is false. Types of loops When you are programming with loops, it helps to understand that there are only a few basic formats that are used repeatedly. At this point, execution proceed to first directive following the WHILE directives' corresponding WEND directive, and terminates the loop. In the main loop, the sketch below reads the value of a photoresistor on analog pin 0 and uses it to fade an LED on pin 9. While loop This example shows how to use the While. Loop While DefResp = vbYes • WhileWend 'Example. 'QBASIC GORILLAS 2. To open an existing file in QBasic, you cannot simply go to your user drive and double click on the saved file’s icon. For example, the menu driven program typically continue till user selects to exit his or her main menu (loop). Wend Loop In VBScript, While. Syntax: WHILE (condition) statements WEND Example: REM a program to print series from 1 to 10; CLS c = 1 WHILE c <= 10 PRINT c c = c + 1 WEND END. Code placed between Do Until and Loop will be repeated until the part after Do Until is true. ∟ "While" Statements. Nested Loops. And, while you're at it, I would be very happy if you would explain to me just how to get rid of a repeating key, after holding it down. You can do this using a while loop. They can be used to carry out a specific task in an iterative manner till such time that a condition is met (or the VBA loop is terminated). This condition is tested each pass through the loop. Specify whether the loop continues "while" the expression is true or "until" the expression is true, using the WHILE and UNTIL statements, respectively. In the given article we are going to discuss the difference between 'while' loop and 'do while' loop. If it is still true, the process is repeated. done # End of outer loop. While loop 'while' statement just takes the stop condition. The earliest while loop examples had numerical tests and the code to get ready for the next loop just incremented a numerical variable by a fixed amount. how to write a program that prints word in a format that all the letters in the word are capital except the beginning and the ending one. I like the Do loop because you can use the Exit Do statement. SOLVED QBASIC SET A AND B Set A. Loop While number < 201. focus), and type “w”. For Button2 as the Do While Button, put this code below. Wend represents end of while block in VBScript If condition become false then statement next to Wend Keyword will be executed. 1 Help file Microsoft Corporation. First while entering. ZIP (warning: it is about 5MB long) Unzip all files of this archive in a directory of your choice and set IMGDIR to corresponding path. Description: Indicates the end of a do. The WEND statement transfers the control back to step 1. For example, have a look at the following code : while fileProcessed <> "" msgBox fileProcessed wend This is an infinite loop where a message box is displayed in each iteration. When condition evaluates to False, program execution skips to the first statement following the Wend statement. Maybe you didn't show us the entire code, without which it's hard to determine your problem. Scope specifies the spatial extent of a variable; Lifetime specifies the time extent. iii) There is no EXIT WHILE statement. before the first iteration is a condition test, the use of this loop is excellent in situations where perhaps we don't need to execute the cycle. Screen resolution State true or false. A loop (in QBasic) is the repeating of code until a designated stop point is reached. String functions 2. loop block, a section of code that will execute continuously, or. DOLOOP provides a better way to execute statements in a program loop. Qbasic Classes Let's get right to the meat of things. hercules 4 hercules graphics 4 icon 4 images 4 install 4 install program 4 monochrome 4 puzzle 4. But this would seriously slow the execution of the application, as TestComplete would be continuously testing. Articles and Tutorials, QBasic-Forums. It was initially developed by Mercury Interactive and then acquired by HP. ” Format of the VBA While Wend Loop. The statements written between DO WHILE and LOOP form the body of the loop. It's a lot more fun to create your own games to play on the computer. Examples of wend in a since January there have been 10,393 returns by migrants to Mexico while their. The body: This is the code within the. Syntax: WHILE Condition BEGIN Sql Statements END. Until/While loop. DO WHILE loop; Looping through table records; WHILE LOOP. The only difference is the While loop starts with While (rather than Do While) and ends with Wend (rather than Loop). Do While Edit. 0 Looping with the for and foreach Statements works well when you know in advance how many times a particular task needs to be repeated in a program. For example: for (i = 1 ; i10 ; i++) {. You hand in this assignment by showing it to the lecturer when it is completed. Even if you don't have the foggiest idea how to write or even run a program, then this section is just for you. ) The DO WHILE/DO UNTIL/LOOP WHILE/LOOP UNTIL syntax is too verbose; you're better off using WHILE or GOTO as appropriate. It was designed for the IBM PC and is similar to the IBM BASICA language, but it is a self-contained executable and unlike other BASIC derived languages; it does not need the ROM BASIC. Here's the While loop's syntax (note that you used to end this loop with Wend in VB6 and before—that's changed to End While now):. exit 0 See Example 27-11 for an illustration of nested while loops , and Example 27-13 to see a while loop nested inside an until loop. These while loops will calculate the Factorial of a number. A loop (in QBasic) is the repeating of code until a designated stop point is reached.