Page 203 - DCAP408_WEB_PROGRAMMING
P. 203

Unit 7: Introduction to ASP (Active Server Pages)




                 Loop                                                                           Notes
                 %>
          The While statement executes the statements in its loop until the given condition remains true.
          The moment it becomes false, the loop halts.
          Remember to end the While Statement with the Wend Keyword.

          A variation of the While loop that tests the condition after the loop is the Do-loop.
                 <%
                 Do
                 TimePass()
                 Until  ExamDate  –  Now  =  30
                 %>
          I hope the meaning is amply clear from the example above.

          Self Assessment

          Fill in the blank:
          13.  Using the  ............................. statement assures  that  all items in that  collection will  be
               processed, and no “Array Index Out Of Bounds” errors will be generated.

          7.7 Select Case

          To make a choice between a set of items that can be assigned to a variable, use the Select Case
          statement.
          <%
                 Select Case Choice
                 Case “1”:

                 Response.Write “You chose 1”
                 Case “2”:
                 Response.Write “You chose 2”
                 Case “3”:

                 Response.Write “You chose 3”
                 Case “4”:
                 Response.Write “You chose 4”
                 End Select

          %>

          7.8 ASP Arrays

          Arrays in ASP follow the exact same form and rules as those arrays in VBScript. You can create
          an array of specific size or you can create a dynamic sized array. Below we have examples of
          both types of arrays.




                                           LOVELY PROFESSIONAL UNIVERSITY                                   197
   198   199   200   201   202   203   204   205   206   207   208