Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expected 'End' 1

Status
Not open for further replies.

theocraticmind

Programmer
Apr 19, 2002
318
CA
this may very well be something stupid. i haven't used asp in a long time, but desided to go through a script i wrote but never finished, and finish it. seeing as i'm extreemly rusty, i don't see the problem with this... here is the code:

<%if session(&quot;name&quot;) <> &quot;&quot; then%>
Welcome <%=session(&quot;name&quot;)%><br>
<a href=&quot;signin.asp?out=true&quot;><font size=&quot;1&quot;>sign out</font></a>
<%else%>
<a href=&quot;signin.asp&quot;>Sign In</a>
<%end if%> 'this is the line in question, line 56

then i get this error:

Microsoft VBScript compilation error '800a03f6'

Expected 'End'

/dfxboard/top.txt, line 56

what is the problem?
 
That looks okay to me, in fact it works perfectly here on my system. Runs fine, no compile error at all.

I'm thinking that the problem is higher up in the code somehow. Perhaps an IF (or more than one?) that is started earlier, but not properly closed. (And it's not until line 56 that the compiler finally realizez this is not going to work.)

What do you think?
 
thats the only asp code on the page...although it is an include for another page, the only thing above the include is <%response.buffer=true%>, and i don't see how that could be a problem...
 
Just for the fun of it, perhaps try it like this just to see if the behavior changes in any way.

<%
If session(&quot;name&quot;) <> &quot;&quot; Then
Response.write(&quot;Welcome &quot; & session(&quot;name&quot;) & &quot;<br>&quot;)
Response.write(&quot;<a href='signin.asp?out=true'><font size='1'>sign out</font></a>&quot;)

else

Response.write(&quot;<a href='signin.asp'>Sign In</a>&quot;)
End If
%>
 
i get the same thing, but it changes to line 59. this is where the end if is now located...
 
Okay, well at least that makes sense, because it's not really any different.

Anyway, there's nothing wrong with that piece of code (both versions). imho, problem has to be somewhere else. I guess the rest is too long too post?
 
for some reason new_topic.txt is processing the html. just ignore it and view sorce, it's not an asp server, so you can see it all.

thanks for any help [medal]
 
I dunno.
It's hard to really tell from here, because on those links you show, we are seeing the files rendered, instead of seeing just the plain .asp source files (in ascii format) that created those rendered results.

I am wondering this:
In the file new_topic.txt, you have these first two lines:

<%response.buffer=true%>
<!--#INCLUDE FILE=&quot;top.txt&quot;-->


But top.txt contains asp code that you want to run. Shouldn't the reference therefore be this:


<!--#INCLUDE FILE=&quot;top.ASP&quot;-->
so that your web server knows that you want that asp code interpreted as asp, and not just as plain text.

--------------------------
Like I said, it's hard to tell because I'm not seeing the actual source files.

By the way, there's an unmatched quote in the bottom file that will cause some problems for you:

</td></tr>
<tr><td>
<hr color=&quot;#0000ff&quot; width=&quot;100%>
 
i can asure you, the code you see by viewing the sorce of those txt files is the correct code. ok, by fixing the .txt thing for the include a i get a new error:

Microsoft VBScript compilation error '800a0411'

Name redefined

/dfxboard/new_topic.asp, line 47

Dim objFSO 'FileSystemObject Variable
----^

any help is greatly apriciated.
 
aww man... all the files that have to do with this were from a backup i just recently resored. i just now realised that i forgot to back up the global.asa file. i think all that was there was declaring some variables, but there may have been more. could this be the problem?
 
Okay, good. Looks like we got by one problem, only to find another. (That's always the way, isn't it.)

We're into an area here where I don't feel as strong; if we don't solve this, I think the best thing is to start a new thread, with a new Subject that better describes the new problem. (Then you're more likely to attract someone better than me.)

However, I'm thinking this probably has something to do with the fact that you are DIMing a name that has already been DIMed earlier, around line 19.

Isn't there a REDIM command that you use in this situation (I dunno, I'm not a VB pgmr, but it seems I read something like that once.) So, try a REDIM, or perhaps don't do a new DIM at all (since it is already defined), and just go ahead and do your new SET statement.

Are we that lucky that this might work?
 
thank you very much. not diming then at all the second time worked fine. i've run into a whole new set of problems, i'm in the process of working on them. but this has gotten my asp juices flowing, so i'll probly be able to handel them.
 
The other prob you've probably run into is that you're checking for
<%if request.form(&quot;topic&quot;) = &quot;&quot; or request.form(&quot;topic&quot;) = nothing then %>

The 'nothing' in this statement is an object reference.
If you change the above to:

<%if request.form(&quot;topic&quot;) = &quot;&quot; or request.form(&quot;topic&quot;) = null then %>

your code should work

HTH
 
thanks. ya, that was the first error i ran into, i fixed it right away though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top