answersLogoWhite

0


Best Answer

Loops are one of the most important structures in any programming language. They enable you to repeat certain commands over and over again, as many times as you need instead of having to type in the same command lots of times. Say you wanted to count from 1 to 100 and display the numbers. You could use 100 commands to do it which would be a slow and tedious way. With a loop you can tell the computer to repeat the same command 100 times, and just automatically change the number so that it starts at 1 and keeps on going until it reaches 100. In the slow way you would do something like this:

Msgbox("1")

Msgbox("2")

Msgbox("3")

...and so on up to 100, so you would have 100 lines of colde. With a loop you could do it all in just 3 lines using a FOR loop:

For n=1 to 100

Msgbox(n)

Next

It first gives n the value of 1 and displays it and then gives it the value of 2 and displays it and then gives it the value of 3 and displays it and so on. So it starts at 1 displays it and then goes to the next value, and keeps doing so until it reaches 100. If you then wanted to do it up to 200 or 1000 or whatever, it will still be just those 3 lines of code with just the 100 in the first line changed to whatever value you wanted. Programming is full of repetitive actions, so loops are essential. All languages provide different kinds of loops.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why are loops used in Visual BASIC programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why visual basic is referred to as a tool?

Visual Basic is a computer programming language that can be used to create programs, but it is not a program in itself.


.net is the programming language?

No. .NET is a framework, not a programming language. It is the common framework used by the C#, F# and Visual Basic programming languages.


What is clear basic?

Clear Basic is a programming language based off of Visual Basic that's used for modifying Clarify programs.


State three reasons that visual basic is the most widely used programming language in the world?

Visual Basic is not the most widely used programming language in the world. Aside from anything else, it only works on Windows. Java is the most widely used programming language in the world, closely followed by C++. And there are plenty more languages that are far more widely used than Visual Basic, including C, Python, Ruby and Perl, to name but a few. Even C#, which is also a Windows-only programming language, is more popular than Visual Basic.


Is visual basic a DBMS?

No, it's a ide and and programming langauage used to create windows programs.


What is VB program?

Visual Basic is a powerful programming language used to make programs for use with Windows. VB can make from either the simplest, to the most advanced programs. Visual Basic is very easy to learn compared to other languages.


Are the following interrelated VisualBasic Dreamweaver Javascript?

In some ways they are and on other ways they are different. They are all technologies for creating things in computing. Javascript and Visual BASIC are programming languages, whereas Dreamweaver is an application for creating websites. Javascript is particularly used for programming on websites, linking it to Dreamweaver, whereas Visual BASIC is used for general programming.


What is the significance of visual basic programming?

Its a programming language and IDE to develop an "System application or Web applications" developed by Microsoft. for more details go to microsoft official site.. visual basic is an event driven programming language. thus it is used to design forms and some not so advanced animations.


Can you use basics language with win Xp?

Yes. Both programming languages.. -Visual BASIC 6 -Visual BASIC.NET ...can be used on Windows XP platform.


Which is the major platform used in websites?

Websites use a variety of programming languages, although HTML and Visual Basicare used the most. HTML is used to design the basic skeleton of the website and Visual Basic adds interactivity like buttons and checkboxes and such.


What type of language is BASIC?

Basic was one of the very first programming languages used in DOS. It is not object oriented and is obsolete. If you want to learn to programe start with Visual Basic no BASIC.


What programming language does Microsoft word?

Word is mostly written in C++. It also contains a programming language which is Visual Basic for Applications, which is an implementation of Microsoft's Visual Basic 6. Search Wikipedia for more info.