Google Answers Logo
View Question
 
Q: VISUAL BASIC ( No Answer,   1 Comment )
Question  
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
Answer  
There is no answer at this time.

Comments  
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.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

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 Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy