Page 200 - DCAP408_WEB_PROGRAMMING
P. 200

Web Programming




                    Notes              Statement1
                                   ElseIf Condition2 is True Then
                                       Statement2
                                   ElseIf Conditionk is True Then

                                       Statementk
                                   End If
                                   The  program  will  first  examine  Condition1.  If  Condition1  is  true,  the  program  will
                                   executeStatment1 and stop  examining conditions.  If Condition1 is false,  the program  will
                                   examineCondition2 and act accordingly. Whenever a condition is false, the program will continue
                                   examining the conditions until it finds one. Once a true condition has been found and its statement
                                   executed, the program will terminate the conditional examination at End If.
                                   There is still a possibility that none of the stated conditions is true. In this  case, you should
                                   provide a “catch all” condition. This is done with a last Else section.

                                       !

                                     Caution  The Else section must be the last in the list of conditions and would act if none of
                                     the primary conditions is true.
                                   The formula to use would be:
                                   If Condition1 is True Then

                                       Statement1
                                   ElseIf Condition2 is True Then
                                       Statement2

                                   ElseIf Conditionk is True Then
                                       Statementk
                                   Else
                                       CatchAllStatement
                                   End If

                                   Self Assessment


                                   Fill in the blanks:
                                   11.  The simplest technique used to validate a ............................. is to check whether it is true.
                                   12.  Whenever a condition is ............................., the  program will continue examining  the
                                       conditions until it finds one.

                                   7.6 Loops

                                   For-Next LoopsFor-Next Loops
                                   The syntax is as follows

                                          <%
                                          For  I  =  1  to  10


          194                               LOVELY PROFESSIONAL UNIVERSITY
   195   196   197   198   199   200   201   202   203   204   205