home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_06.cab / samp9nfr.asp < prev    next >
Text File  |  1997-10-19  |  3KB  |  38 lines

  1.  <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp9nfr.asp&srcfile=Simple/Looping" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  3. <HTML>
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
  6. <title>Looping</title>
  7. <script language="JavaScript">
  8.  
  9.     szNavVersion = navigator.appVersion
  10.  
  11.     if (navigator.appName == "Microsoft Internet Explorer") {
  12.     if (szNavVersion.indexOf ("4.") >= 0) {
  13.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  14.     } else {
  15.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  16.     }
  17.     }
  18.     else if (navigator.appName == "Netscape") {
  19.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  20.     }
  21.     else {
  22.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  23.     }
  24.  
  25. </script>
  26. <META NAME="DESCRIPTION" CONTENT="Internet Information Server reference information"></HEAD>
  27. <BODY BGCOLOR=#FFFFFF TEXT=#000000>
  28. <font face="Verdana, Arial, Helvetica">
  29. <h3><a name="_looping"></a>Looping</h3>
  30. <p>
  31. Looping is one of the most important flow-control mechanisms in a programming language. Looping constructs provide the foundation for any application that must repetitively perform a task, whether that task be adding 1 to a variable, reading a text file, or processing an e-mail message and sending it across the country. </p>
  32. <p>
  33. VBScript and JScript provide several looping mechanisms. This sample demonstrates the three most commonly used looping statements, <b>For ... Next</b>, <b>Do ... Loop</b>, and <b>While ... Wend</b>. These three statements are subtly different, and the scripting situation will frequently dictate which of the three would fit the best. For the purpose of this sample, however, each type of looping statement is used to accomplish the same task, printing a greeting five times, using progressively larger font sizes. For each looping statement, the variable<b> </b><i>i</i> is initialized, and the test condition for the loop is defined such that <i>i</i> will never be greater than 5. The variable is then incremented by 1 for each iteration of the loop. </p>
  34. <hr class="iis" size="1">
  35. <p align="center"><em><a href="/iishelp/common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
  36. </BODY>
  37. </HTML>
  38.