locked
nested ifelse stmts RRS feed

  • Question

  • User1386200375 posted

    can somebody plzz write me the syntax of nested ifelse statements in vb.net 

    Friday, April 4, 2008 4:52 AM

Answers

  • User418373899 posted

    Example one 

     if soemcode then

         if somecode then

               if soemcode then

                    somecode

               end if

          end if

    end if

    Example Two

    if Somecode then

      somecode

    elseif soemcode then

       soemcode

    elseif soemcode then

     soemcode

    else

     soemcode

    end if

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 4, 2008 5:57 AM

All replies

  • User418373899 posted

    Example one 

     if soemcode then

         if somecode then

               if soemcode then

                    somecode

               end if

          end if

    end if

    Example Two

    if Somecode then

      somecode

    elseif soemcode then

       soemcode

    elseif soemcode then

     soemcode

    else

     soemcode

    end if

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 4, 2008 5:57 AM
  • User-1410257499 posted

    Example one 

     if soemcode then 'and

         if somecode then  'and

               if soemcode then 'and

                    somecode 'then do this code

               end if

          end if

    end if

    Example Two

    if Somecode then

      somecode

    elseif soemcode then ' or if this is true

       soemcode

    elseif soemcode then 'or if this is true

     soemcode

    else ' or if none of the others are true

     soemcode

    end if

     

    The first example is an AND function and the second is a type of an OR function

    Thursday, April 10, 2008 10:35 AM