|
|
Subject:
VISUAL BASIC
Category: Computers > Programming Asked by: valeclau-ga List Price: $2.00 |
Posted:
15 Oct 2004 05:43 PDT
Expires: 14 Nov 2004 04:43 PST Question ID: 415236 |
Argue the advantages, disadvantages, and provide usage examples of the following: For Next Loops Do While Loops Do Until Loops |
|
There is no answer at this time. |
|
Subject:
Re: VISUAL BASIC
From: blowdart-ga on 15 Oct 2004 06:23 PDT |
for loops : used when you wish to run something a number of times for homeWorkQuestions = 1 to 10 answer(homeWorkQuestions) = "copied from google" next do while : used to loop until a condition is fulfilled. Runs at least once. do askForHomeWorkHelp() while (unansweredQuestions > 0) do until : used to loop until a condition is fulfilled, with the condition evaluated first, may not run at all do until (unansweredQuestions = 0) askForHomeWorkHelp() loop As they all perform different ways of controlling flow the advantages and disadvantages are specific to the situation in which they are used. For example you would use do until if you are opening a file and wish to process every linein the file. You cannot use a for loop as you don?t know how many lines there are. If you use a do while the operation inside the loop will execute once, and you cannot be sure the file is not, in fact, empty. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |