Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 4th, 2006, 03:53 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Expected statement

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("<b>Your account Has been deleted !</b>")
59>If Request.QueryString("msg") = "5748768134" Then Response.Write("<b>Your session has timed out please login again</b>")
60>End If
61>If Request.QueryString("mes") = "541236987" Then Response.Write("<b>Your session has timed out please login again</b>")
62>End If %>

 
Old January 4th, 2006, 06:28 PM
Authorized User
 
Join Date: Jun 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hcweb
Default

Try this:

<%
If Request.QueryString("msg") = "3754658" Then
Response.Write "<b>Your account Has been deleted !</b>"
ElseIf Request.QueryString("msg") = "5748768134" Then
Response.Write "<b>Your session has timed out please login again</b>"
ElseIf Request.QueryString("mes") = "541236987" Then
Response.Write "<b>Your session has timed out please login again</b>"
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( "<b>Your account Has been deleted !</b>") <---end if
59>If Request.QueryString("msg") = "5748768134" Then Response.Write("<b>Your session has timed out please login again</b>")
60>End If
61>If Request.QueryString("mes") = "541236987" Then Response.Write("<b>Your session has timed out please login again</b>")
62>End If %>

Hope that helps!
Chris
 
Old January 4th, 2006, 07:00 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

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 "<b>Your account Has been deleted !</b>"
elseIf Request("msg") = "5748768134" Then
   Response.Write "<b>Your session has timed out please login again</b>"
elseif Request("mes") = "541236987" Then
   Response.Write "<b>Your session has timed out please login again</b>"
End If
%>

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

Wind is your friend
Matt
 
Old January 4th, 2006, 07:04 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
expected Then Adam H-W Classic ASP Basics 6 April 17th, 2008 05:41 AM
Error: Expected end of statement crabjoe Classic ASP Basics 3 December 4th, 2007 12:52 AM
Invalid SQL statement expected; ‘DELETE’,’INSERT’, knowledge76 Access VBA 4 May 21st, 2007 08:04 AM
expected end of statement Adam H-W Classic ASP Databases 3 January 4th, 2005 05:37 AM
expected end of statement....help.... chaoz83 Classic ASP Databases 3 September 23rd, 2003 01:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.