25. marts 2005 - 15:47Der er
8 kommentarer og 1 løsning
fejl : expected end
Jeg har set mig blind her ... jeg får en "expected end of statement"
<% If (IsNumeric(Request.QueryString("input"))) And (Request.QueryString("input") <> "") Then if request.querystring("input") < 1 then file = ""SELECT * FROM log WHERE year = "" & intYEAR & "" AND month = "" & intMONTH & "" else if request.querystring("input") = all then file = ""SELECT * FROM log WHERE year = "" & intYEAR & "" AND month = "" & intMONTH & "" else file = ""SELECT * FROM log WHERE year = "" & intYEAR & "" AND month = "" & intMONTH & "" and id = "" & CLng(Request.QueryString("input")) & "" End if End if else file = ""SELECT * FROM log WHERE year = "" & intYEAR & "" AND month = "" & intMONTH & "" End if %>
<% If (IsNumeric(Request.QueryString("input"))) And (Request.QueryString("input") <> "") Then if request.querystring("input") < 1 then file = ""SELECT * FROM log WHERE year = "" & intYEAR & "" AND month = "" & intMONTH & "" elseif request.querystring("input") = all then file = ""SELECT * FROM log WHERE year = "" & intYEAR & "" AND month = "" & intMONTH & "" else file = ""SELECT * FROM log WHERE year = "" & intYEAR & "" AND month = "" & intMONTH & "" and id = "" & CLng(Request.QueryString("input")) & "" End if else file = ""SELECT * FROM log WHERE year = "" & intYEAR & "" AND month = "" & intMONTH & "" End if %>
<% If (IsNumeric(Request.QueryString("input"))) And (Request.QueryString("input") <> "") Then If Request.QueryString("input") < 1 Then File = "SELECT * FROM log WHERE year =" & intYEAR & " AND month =" & intMONTH Elseif Request.QueryString("input") = all Then File = "SELECT * FROM log WHERE year =" & intYEAR & " AND month =" & intMONTH Else File = "SELECT * FROM log WHERE year =" & intYEAR & " AND month =" & intMONTH & " AND Id =" & CLng(Request.QueryString("input")) End If Else File = "SELECT * FROM log WHERE year =" & intYEAR & " AND month =" & intMONTH End If %>
Desuden bør du bruge store bogstaver hvor det er muligt; f.eks. ved If, ElseIf, Else, End If, Request.QueryString, osv., da det bidrager til større overkuelighed i ASP-koden (så man ikke stirrer sig blind på koden).
Et godt tip jeg fik engang, og har gjort flittigt brug af siden...
Glad for at jeg kunne hjælpe, og tak for points :-)
Apo
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.