Subject: Expected statement
Posted By: jonnyfive Post Date: 1/4/2006 2:53:17 PM
is there any way i can get some help i got a problem i've removed the code and the page works fine but i need the code any ideas

Microsoft VBScript compilation (0x800A0400)
Expected statement
/talk/index.asp, line 60
End If

57><%
58>If Request.QueryString("msg") = "3754658" Then   Response.Write("<font color='#FF0000'><b>Your account Has been deleted !</b></font>")
59>If Request.QueryString("msg") = "5748768134" Then Response.Write("<font color='#FF0000'><b>Your session has timed out please login again</b></font>")
60>End If
61>If Request.QueryString("mes") = "541236987" Then Response.Write("<font color='#FF0000'><b>Your session has timed out please login again</b></font>")
62>End If %>

Reply By: hcweb Reply Date: 1/4/2006 5:28:09 PM
Try this:

<%
If Request.QueryString("msg") = "3754658" Then
Response.Write "<font color='#FF0000'><b>Your account Has been deleted !</b></font>"
ElseIf Request.QueryString("msg") = "5748768134" Then
Response.Write "<font color='#FF0000'><b>Your session has timed out please login again</b></font>"
ElseIf Request.QueryString("mes") = "541236987" Then
Response.Write "<font color='#FF0000'><b>Your session has timed out please login again</b></font>"
End If
%>

From what I saw you have parenthesis outside of the quotations in your response.writes, and you're missing an "end if" on the first "if" statement.

57><%
58>If Request.QueryString("msg") = "3754658" Then   Response.Write( "<font color='#FF0000'><b>Your account Has been deleted !</b></font>") <---end if
59>If Request.QueryString("msg") = "5748768134" Then Response.Write("<font color='#FF0000'><b>Your session has timed out please login again</b></font>")
60>End If
61>If Request.QueryString("mes") = "541236987" Then Response.Write("<font color='#FF0000'><b>Your session has timed out please login again</b></font>")
62>End If %>

Hope that helps!
Chris
Reply By: mat41 Reply Date: 1/4/2006 6:00:23 PM
jonnyfive

Your problem is the missing end if.  Use elseif statements like hcweb has suggested however your parenthesis are not a problem.  Using parenthesis like this is optional and not required.  Its kind of like writing the full 'response.querystring("someName")' instead of just 'response("someName")'

When IIS serves the web page it looks at all three response objects in the following order:
.qs
.form
.write
So you will only run into a problem if you have a QS and a FORM object named the same.  I would:

<%
If Request("msg") = "3754658" Then   
   Response.Write "<font color='#FF0000'><b>Your account Has been deleted !</b></font>"
elseIf Request("msg") = "5748768134" Then
   Response.Write "<font color='#FF0000'><b>Your session has timed out please login again</b></font>"
elseif Request("mes") = "541236987" Then
   Response.Write "<font color='#FF0000'><b>Your session has timed out please login again</b></font>"
End If
%>

FYI start using style sheets and classes for formatting.  All these <font> and <b> tags are unneccessary and in-efficient.

Wind is your friend
Matt
Reply By: mat41 Reply Date: 1/4/2006 6:04:22 PM
Additionaly (as you can tell I have very little to do today) put trim functions (removes all unwanted leading and trailing spaces) around all your expected values, Eg:

If trim(Request("msg")) = "3754658" Then

Wind is your friend
Matt

Go to topic 38293

Return to index page 403
Return to index page 402
Return to index page 401
Return to index page 400
Return to index page 399
Return to index page 398
Return to index page 397
Return to index page 396
Return to index page 395
Return to index page 394