Jump to content
Striped Fish2

Expected End

Recommended Posts

Okay I am confused I keep running this code and it says

Microsoft VBScript compilation error '800a03f6'Expected 'End'/testfile.asp, line 176

I don't believe I need an end on line 176. Here's my code:
<%special=request.querystring("special")combatround=request.querystring("round")bow=request.querystring("bow")ID=request.querystring("ID")numofenemies=request.querystring("numofenemies")enemy=request.querystring("enemy")user="Glorfindel"'Take one arrow from the user's quiverset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"set rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT equipaccessoryamount FROM Characters WHERE Name='" & user & "'", conndo until rs.EOFfor each x in rs.Fieldsdim amountofarrowsamountofarrows=x.valuenextrs.MoveNextlooprs.closeconn.closearrows=amountofarrows-1set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"sql="UPDATE Characters SET equipaccessoryamount=" & arrows & " WHERE Name='" & user & "'"conn.execute sqlconn.closeIf special="strongshot" then'subtract 2 EPset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"set rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT energypoints FROM Characters WHERE Name='" & user & "'", conndo until rs.EOFfor each x in rs.Fieldsdim energypointsenergypoints=x.valuenextrs.MoveNextlooprs.closeconn.closeIf energypoints=0 thenresponse.write "combat.asp?round=" & combatround & "&ID=" & ID & "&message=Not enought EP to perform attack"Elsenewenergypoints=energypoints-2set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"sql="UPDATE Characters SET energypoints=" & newenergypoints & " WHERE Name='" & user & "'"conn.execute sqlconn.closeEnd IfEnd IfIf bow="Cracked-Bow" thendamage=4If special="strongshot" thendamage=damage+2End IfEnd Ifuserattack="" & user & " fires at " & enemy & " and hits for " & damage & " damage."If enemy="Goblin" and combatround=1 or combatround=2 thencounterattack="Goblin charges towards " & user & ""enemydamage=0ElseIf enemy="Archer" and combatround=1 thencounterattack="Goblin Archer charges towards " & user & ""enemydamge=0ElseIf enemy="Archer" and combatround=2 or combatround > 2 thencounterattack="Archer fires at " & user & " and hits for 3 damage"enemydamage=3ElseIf enemy="Goblin" and combatround=3 or combatround > 2 thenconterattack="Goblin strikes " & user & " for 4 damage"enemydamage=4End Ifset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"If numofenemies=1 thensql="UPDATE Combat SET [round1]='" & userattack & "<br />" & counterattack & "' WHERE CombatID='" & ID & "'"ElseIf numofenemies=2 thensql="UPDATE Combat SET [round1]='" & userattack & "<br />" & counterattack & "<br />" & counterattack & "' WHERE CombatID='" & ID & "'"End IFconn.execute sqlconn.close'Do damageIf numofenemies=2 thentotaldamge=enemydamage*2ElseIf numofenemies=1 thentotaldamage=enemydamageEnd Ifset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"set rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT Enemy1_health FROM Combat WHERE CombatID='" & ID & "'", conndo until rs.EOFfor each x in rs.Fieldsdim enemy1healthenemy1health=x.valuenextrs.MoveNextlooprs.closeconn.closeset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"set rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT hitpoints FROM Character WHERE Name='" & user & "'", conndo until rs.EOFfor each x in rs.Fieldsdim hitpoint######points=x.valuenextrs.MoveNextlooprs.closeconn.closenewhealth=enemy1health-damagecorrecthitpoints=hitpoints-damageset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"sql="UPDATE Combat SET Enemy1_health=" & newhealth & " WHERE CombatID='" & ID & "'"conn.execute sqlconn.closeset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"sql="UPDATE Characters SET hitpoints=" & correcthitpoints & " WHERE CombatID='" & ID & "'"conn.execute sqlconn.closenextround=combatround+1 'Here is line 176 :-/response.redirect "combat.asp?round=" & nextround & "&ID=" & ID & ""%>
any help would be greatly appreciated.

Share this post


Link to post
Share on other sites

Probably best to TAB each of the If's loops ect so that you can work out which one is missing an END. Without the tabs it's difficult to relate which end is from where espescially the nested ones.I tend to put in the closing ends etc vefore putting in the code between them - acts as a safety net and you know that you have got em all.Putting in the tabs and you'll probably spot the relevant missing end.

Share this post


Link to post
Share on other sites

I had double checked it. Hope you already resolved it.There is nothing wrong with this script. I don't know if I missed it.But if there is an error and if this is the full script code so the error code mean Microsoft VBScript Compilation Error which mean one of this situation.

  • [*]Thre is unexpected 'End If' and the expected 'End If' will be at line *****[*]The script is too long that will be difficult for the server to compile it and the server will miss a "End If" thus shorten it.

But the most common occur with that cause this error is the first point. Take a look at this."You are the boss and the server is the boss""Your eye do your work and the VBScript library do their work"Which mean our eyes may missed to some line. It also can occur to the VBScript library that will miss to read some lime because the script is too long.Try testing it.

  • [*]Reuse the connection by using include file= or include virtual= to the connection file thus it will shorten the script.[*]Shorten the length of the script ia a page by doing the same thing as connection.[*]Use option explicit function.[*]Testing with ignore error.

This error also occur to me because I'm also the ordinary person so use 'GOD of Server' line as example below.Without 'GOD of Server' line .................

<%@language="vbscript"%><%Option Explicit%><%Dim DataConnectionParam, DataConnection, DataListDataConnectionParam = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:inetpubwwwrootshare-serverdb.mdb"Set DataConnection = Server.CreateObject("ADODB.Connection")DataConnection.Open DataConnectionParamSet DataList = Server.CreateObject("ADODB.Recordset")DataList.Open "Select * From "&Request.QueryString("Group")&" Order By "&Request.QueryString("Sort")&"",DataConnection,3,3%>
Will produce...........

Microsoft JET Database Engine error '80040e14'Syntax error in FROM clause./Untitled-1.asp, line 14

With 'GOD of Server' line .................
<%@language="vbscript"%><%Option Explicit%><%On Error Resume Next ''GOD of Server' lineDim DataConnectionParam, DataConnection, DataListDataConnectionParam = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:inetpubwwwrootshare-serverdb.mdb"Set DataConnection = Server.CreateObject("ADODB.Connection")DataConnection.Open DataConnectionParamSet DataList = Server.CreateObject("ADODB.Recordset")DataList.Open "Select * From "&Request.QueryString("Group")&" Order By "&Request.QueryString("Sort")&"",DataConnection,3,3%>
Will produce.......... an empty page when testing in browser.Empty page mean your script is wrong from first line to the last line. If the error occur at specific line you will get other result such as, the above code is previewed in a table and under the table is another information not related to the above code. If error occur on the above code, you will see an empty table with not any error of the information under the table. It is mean that some error occur either in the above code or code in the table.Sorry for long lecture. Just try it and have some fun.P/S : The 'GOD of Server' is only the term made by me. Do not take it seriously but the 'On Error Resume Next' line is really exist.

Share this post


Link to post
Share on other sites

Sorry to take so long to reply but I just got some free time again.Anyway I went through it and found the problems with the End's and end if's. But even I had put all the the other test pages that go with on the server it just displayed a white screen. So I added the 'On Error Resume Next' line. But then it just timed out and never even wrote anything to the database. Here's my error:

Active Server Pages error 'ASP 0113'Script timed out/rangedattack.aspThe maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.

And here's my code:
<%special=request.querystring("special")combatround=request.querystring("round")bow=request.querystring("bow")ID=request.querystring("ID")numofenemies=request.querystring("numofenemies")enemy=request.querystring("enemy")user="Glorfindel"'Take one arrow from the user's quiverset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"On Error Resume Nextset rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT equipaccessoryamount FROM Characters WHERE Name='" & user & "'", conndo until rs.EOFfor each x in rs.Fieldsdim amountofarrowsamountofarrows=x.valuenextrs.MoveNextlooprs.closeconn.closearrows=amountofarrows-1set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"On Error Resume Nextsql="UPDATE Characters SET equipaccessoryamount=" & arrows & " WHERE Name='" & user & "'"conn.execute sqlconn.closeIf special="strongshot" then'subtract 2 EPset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"On Error Resume Nextset rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT energypoints FROM Characters WHERE Name='" & user & "'", conndo until rs.EOFfor each x in rs.Fieldsdim energypointsenergypoints=x.valuenextrs.MoveNextlooprs.closeconn.closeEnd IfIf energypoints=0 thenresponse.write "combat.asp?round=" & combatround & "&ID=" & ID & "&message=Not enought EP to perform attack"Elsenewenergypoints=energypoints-2set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"On Error Resume Nextsql="UPDATE Characters SET energypoints=" & newenergypoints & " WHERE Name='" & user & "'"conn.execute sqlconn.closeEnd IfIf bow="Cracked-Bow" thendamage=4End IfIf special="strongshot" thendamage=damage+2End Ifuserattack="" & user & " fires at " & enemy & " and hits for " & damage & " damage."If enemy="Goblin" and combatround=1 or combatround=2 thencounterattack="Goblin charges towards " & user & ""enemydamage=0ElseIf enemy="Archer" and combatround=1 thencounterattack="Goblin Archer charges towards " & user & ""enemydamge=0ElseIf enemy="Archer" and combatround=2 or combatround > 2 thencounterattack="Archer fires at " & user & " and hits for 3 damage"enemydamage=3ElseIf enemy="Goblin" and combatround=3 or combatround > 2 thenconterattack="Goblin strikes " & user & " for 4 damage"enemydamage=4End Ifset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"On Error Resume NextIf numofenemies=1 thensql="UPDATE Combat SET [round1]='" & userattack & "<br />" & counterattack & "' WHERE CombatID='" & ID & "'"ElseIf numofenemies=2 thensql="UPDATE Combat SET [round1]='" & userattack & "<br />" & counterattack & "<br />" & counterattack & "' WHERE CombatID='" & ID & "'"End IFconn.execute sqlconn.close'Do damageIf numofenemies=2 thentotaldamge=enemydamage*2ElseIf numofenemies=1 thentotaldamage=enemydamageEnd Ifset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"On Error Resume Nextset rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT Enemy1_health FROM Combat WHERE CombatID='" & ID & "'", conndo until rs.EOFfor each x in rs.Fieldsdim enemy1healthenemy1health=x.valuenextrs.MoveNextlooprs.closeconn.closeset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"On Error Resume Nextset rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT hitpoints FROM Character WHERE Name='" & user & "'", conndo until rs.EOFfor each x in rs.Fieldsdim hitpoint######points=x.valuenextrs.MoveNextlooprs.closeconn.closenewhealth=enemy1health-damagecorrecthitpoints=hitpoints-damageset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"On Error Resume Nextsql="UPDATE Combat SET Enemy1_health=" & newhealth & " WHERE CombatID='" & ID & "'"conn.execute sqlconn.closeset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"On Error Resume Nextsql="UPDATE Characters SET hitpoints=" & correcthitpoints & " WHERE CombatID='" & ID & "'"conn.execute sqlconn.closenextround=combatround+1response.redirect "combat.asp?round=" & nextround & "&ID=" & ID & ""%>

Share this post


Link to post
Share on other sites

I'm using IIS7.5. This time I'm testing your page. I create your database as needed. These are errors that I get when testing.

  • A lot of variable not declaired.
  • Connection is already open.

I'll take a look for a few time and give you the best solution that I can give.

Share this post


Link to post
Share on other sites

There's no reason to have this code more than once on the page:

set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"On Error Resume Next
You already connected to the database once, why do you need to connect 8 more times? You tell it how to handle errors once, do you think it's going to forget?About "On Error Resume Next", I don't think that's a good idea. Using that essentially disables error handling. Not only are the errors not reported to you, so you can't see the error messages anymore to know what the problems are, but the code doesn't even stop executing. Normally you want the code to stop when there's an error, not keep going with bad data and hope nothing else goes wrong. What if you have a script that updates a database, where the first part of the script you're getting the data, and the second part you're updating the database. If you use Resume Next, and there's an error with getting the data, it's not going to stop, it's going to go right ahead and update the database with bad data. Why would you want it to work that way instead of just stopping when there's an error? Resume Next doesn't fix anything, it hides problems and makes them harder to solve, and it may even cause other problems. That's probably why you're getting a timeout, there's probably an error with one of the database statements. Since it's not stopping on the error, you're telling it to loop until rs.EOF is true, but if there was an error with the database query then rs.EOF is never going to be true.Also, why do you have so many database queries? You're getting individual pieces of information, doing some processing, and then updating each thing. Why not get all of the information at once, in a single query, then do whatever processing you need to on the data, then update everything in one query.It will also help to use option explicit at the top of the script so that you can get errors for undefined variables, those are things you want to fix.

Share this post


Link to post
Share on other sites

Okay I decided to make a new file and transfer over query by query and then test it for errors so it would be easier to troubleshoot. And so I would know where to look. Well here is my code and when I run it I just get a white screen I don't even see an it works line.

<%special=request.querystring("special")combatround=request.querystring("round")bow=request.querystring("bow")ID=request.querystring("ID")numofenemies=request.querystring("numofenemies")enemy=request.querystring("enemy")user="Glorfindel"'Retrieve Arrows in Characters Quiverset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"set rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT Equipaccessoryamount FROM Characters WHERE Name='" & user & "'", conndo until rs.EOFfor each x in rs.Fieldsdim amountofarrowsamountofarrows=x.valuenextrs.MoveNextlooprs.closearrows=amountofarrows-1sql="UPDATE Characters SET equipaccessoryamount=" & arrows & " WHERE Name='" & user & "'"conn.execute sqlconn.closeresponse.write "it works"%>
Edited by justsomeguy

Share this post


Link to post
Share on other sites

If you're just getting a single field from a single record in the database, you don't need to loop. You can replace this:

do until rs.EOFfor each x in rs.Fieldsdim amountofarrowsamountofarrows=x.valuenextrs.MoveNextloop
with something like this:
if rs.EOF thenResponse.Write "User not found."amountofarrows = 0elseamountofarrows = rs.fields.item("Equipaccessoryamount").valueend ifResponse.Write "Found " & amountofarrows & " arrows"

Share this post


Link to post
Share on other sites

There's no reason to have this code more than once on the page:

set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:inetpubwwwrootDragonKwest.mdb"On Error Resume Next
You already connected to the database once, why do you need to connect 8 more times? You tell it how to handle errors once, do you think it's going to forget?

 

Yup. I agree with mr. justsomeguy. That is what I mean reuse the connection. Everytime you want to make a recordset, just reuse the connection. Here some example.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><%Option Explicit%><%' Declair connection and recordset variables and open the database connection. Just a connection.Dim ConnParam, Conn, rsUser, rsAddUpdContact, rsUpdContact, rsAddContactConnParam = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:inetpubwwwroottestexMy-dB.mdb" ' This is connection parameter.Set Conn = Server.CreateObject("ADODB.Connection") ' Set the connection object.Conn.Open ConnParam ' Open the connection.' The arterisk (*) means SELECT all field / read all field in the User table where the data is belong to Request("User"). In this case I use Request.QueryString("User")' Open the User tableset rsUser = Server.CreateObject("ADODB.Recordset")rsUser.Open "SELECT * FROM UserData WHERE UserUsername = '"&Request.QueryString("User")&"'",conn,3,3 ' http://www.w3schools.com/ADO/met_rs_open.asp' Open the ContactInfo table and I reuse the connectionset rsAddUpdContact = Server.CreateObject("ADODB.Recordset")rsAddUpdContact.Open "SELECT * FROM ContactInfo WHERE ContactInfoUsername='"&Request.QueryString("User")&"'",conn,3,3 ' http://www.w3schools.com/ADO/met_rs_open.aspIf Not rsAddUpdContact.EOF ThenSession("Data") = "True" 'If user existElseSession("Data") = "False" 'If user not existEnd IfrsAddUpdContact.Close ' Close the rsAddUpdContact RecordsetSet rsAddUpdContact = Nothing ' Burn / Eliminate the rsAddUpdContact RecordsetIf Not rsUser.EOF Then ' If user exist in User tableIf Session("Data") = "True" Then ' If user exist in ContactInfo table' Open ContactInfo table and I reuse the connectionset rsUpdContact = Server.CreateObject("ADODB.Recordset")rsUpdContact.Open "SELECT * FROM ContactInfo WHERE ContactInfoUserName='"&Request.QueryString("User")&"'",conn,3,3 ' http://www.w3schools.com/ADO/met_rs_open.asprsUpdContact.Update ' Because user already exist in ContactInfo table, so just update it.' I'm not closing the rsUser Recordset yet because I want to use it herersUpdContact("ContactInfoPhone") = rsUser("UserPhone") ' Take UserPhone from rsUser Recordset and put it in ContactInfoPhone of rsUpdContact RecordsetrsUpdContact("ContactInfoEmail") = rsUser("UserEmail") ' Take UserEmail from rsUser Recordset and put it in ContactInfoEmail of rsUpdContact RecordsetrsUpdContact.Update ' Confirm updated all datarsUpdContact.Close ' Close the rsUpdContact RecordsetSet rsUpdContact = Nothing ' Burn / Eliminate the rsUpdContact RecordsetrsUser.Close ' Close the rsUser RecordsetSet rsUser = Nothing ' Burn / Eliminate the rsUser Recordsetconn.Close ' Close the connectionSet conn = Nothing ' Burn / Eliminate the connectionResponse.Redirect("message.asp?msg=Success :<br> "&Request.QueryString("User")&" had been updated")Else ' If user exist in ContactInfo table' Open ContactInfo table and I reuse the connectionset rsAddContact = Server.CreateObject("ADODB.Recordset")rsAddContact.Open "SELECT * FROM ContactInfo",conn,3,3 ' http://www.w3schools.com/ADO/met_rs_open.asprsAddContact.AddNew ' Because user is not exist in ContactInfo table, so add new data.rsAddContact("ContactInfoUsername") = rsUser("UserUsername") ' Take UserUsername from rsUser Recordset and put it in ContactInfoUsername of rsUpdContact RecordsetrsAddContact("ContactInfoPhone") = rsUser("UserPhone") ' Take UserPhone from rsUser Recordset and put it in ContactInfoPhone of rsUpdContact RecordsetrsAddContact("ContactInfoEmail") = rsUser("UserEmail") ' Take UserEmail from rsUser Recordset and put it in ContactInfoEmail of rsUpdContact RecordsetrsAddContact.Update ' Confirm updated all datarsAddContact.Close ' Close the rsAddContact RecordsetSet rsAddContact = Nothing ' Burn / Eliminate the rsAddContact RecordsetrsUser.Close ' Close the rsUser RecordsetSet rsUser = Nothing ' Burn / Eliminate the rsUser Recordsetconn.Close ' Close the connectionSet conn = Nothing ' Burn / Eliminate the connectionResponse.Redirect("message.asp?msg=Success :<br> "&Request.QueryString("User")&" had been added to the Contact Info.")End IfElse ' If user is not exist in User tablersUser.Close ' Close the rsUser RecordsetSet rsUser = Nothing ' Burn / Eliminate the rsUser Recordsetconn.Close ' Close the connectionSet conn = Nothing ' Burn / Eliminate the connectionResponse.Redirect("message.asp?msg=Error :<br> "&Request.QueryString("User")&" / User not found.")End If%>
I reuse the connection, I reuse the recordset, I eliminate the recordset, I eliminate the connection.Download the example here. I create it and upload it in my megaupload account. DOWNLOAD. Edited by justsomeguy

Share this post


Link to post
Share on other sites

I'm sure you are still don't understand about On Error Resume Next. I will give you an example. Test it. The best advice that I can give, just follow the advice from mr.justsomeguy because he is more expert than me.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><%Option Explicit%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title></head><body><%' Dim is Dimension. Declairing it make the code executed more fast than not declair.Dim Sent1On Error Resume NextSent1 = "Hello 1<br>"Sent2 = "Hello 2<br>"Sent3 = "Hello 3<br>"Response.Write(Sent1)Response.Write(Sent2) ' Does not appear in screen. Something wrong here or with it related code. You are not declairing Sent2Response.Write(Sent3) ' Does not appear in screen. Something wrong here or with it related code. You are not declairing Sent3' You can use other example that does't need to declairing variable.' On Error Resume Next is a statement that will bypass error and bypass the output that produce error.' For me, it is not a code that just to baypass the error. I manipulated it to detect error.' If you doesn't know how to manipulate it or not understand how to manipulate it after read this, just use the code AS IT.' In published website, On Error Resume Next is a code to bypass small error that will not affect a lot of data or output.' So I just manipulate it on testing to detect error, not for publishing.'HOW TO USE MANIPULATE IT???' 1. Test your script without On Error Resume Next' 2. If error occur, it will appear in browser.' 3. Try to correct that error.' 4. If the error still occur and you still doest't know to where to correct it, put On Error Resume Next above the <html> section. (A page only need a On Error Resume Next, not 2, 3 or more.)' 5. Test in browser.' 6. Output for correct code will appear in the browser. In this case, you must be able to predict or imagine what is the output.' 7. So correct that code that cause the error.%></body></html>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...