VBScript,ASP的IF ELSEIF和IF ELSE IF的区别

IF
ELSEIF
END IF

    IF Keyword="" THEN
        Response.Redirect "index.asp"
    END IF
   
    If isTreaty="1" And isshop="" Then
        SQL = "proc_getTreatyCommunity"
    ElseIf isTreaty="1" And isshop="1" Then
        SQL = "proc_getTreatyShops"
    Elseif    nnearby ="" Then   
        Parameter = "'""" & Keyword & """'"
        SQL ="proc_getTitle " & Parameter & "," & nCity   
    Else
        Parameter = "'""" & Keyword & """'"
        nNearby =  "'""" & nNearby & """'"
        SQL ="PROC_getnearBy "&nNearby&",'"& nCity&"',"&Parameter   
    End If       
 

IF
ELSE IF
END IF

    IF Keyword="" THEN
        Response.Redirect "index.asp"
    END IF
   
    If isTreaty="1" And isshop="" Then
        SQL = "proc_getTreatyCommunity"
    ElseIf isTreaty="1" And isshop="1" Then
        SQL = "proc_getTreatyShops"
    Elseif    nnearby ="" Then   
        Parameter = "'""" & Keyword & """'"
        SQL ="proc_getTitle " & Parameter & "," & nCity   
    Else
        Parameter = "'""" & Keyword & """'"
        nNearby =  "'""" & nNearby & """'"
        SQL ="PROC_getnearBy "&nNearby&",'"& nCity&"',"&Parameter   
    End If       
    END If
    END If

需要在下面多谢几个END IF

所以大家要记住写成ELSEIF,不要写成ELSE IF

你可能感兴趣的:(VBScript)