Anyone?
Printable View
Anyone?
Hey Doomed,
The problem at line 11772 is fixed now isn't it?
Was that fixed with rsPlayer("warid") = abs(iWarid)?
The new issue seems to be at line 12123?
In that block of code you posted, this part is going to give you trouble because it's only partly commented out. Every line needs to have a single-quote to comment it out unless you want to only comment out the if conditional and some of the surrounding code:
Code:' if rsplayer("gameshosted") <> 0 and iMinGamesHosted <> 0 then
rsplayer("ranking") = cdbl(rsplayer("gamesplayedranking")) + _
cdbl(rsplayer("victoryrtranking")) + _
cdbl(rsplayer("appgranking")) + _
cdbl(rsplayer("aenptsranking")) + _
cdbl(rsplayer("uppranking"))
' else
' rsplayer("ranking") = cdbl(20)*((20 - rsplayer("gameshosted"))/20) + _
' cdbl(20)*(rsplayer("gamesplayed")/iMaxGamesPlayed) + _
' cdbl(20)*(cdbl(iVictoryRT)/cdbl(iMaxVictoryRT)) + _
' cdbl(20)*(cdbl(iAttritionRT)/cdbl(iMaxAttritionRt)) + _
' cdbl(20)*(rsPlayer("upp").value/iMaxUPP)
' end if
I don't know, because regardless what I do I see the other error.... so maybe it's fixed or maybe not. I'm sure I will know it when the new issue has been solved.
I did not comment anything out there. It was originally commented out in the script. Shall I uncomment it?
Well, if I remove all of the commented out code and reformat it a bit for clarity this is what you have left:
I would run that code and see where the error lies.Code:
' Calculate preliminary rankings
rsplayer.open "select * from war_rcstats where gamesplayed >=" & iMinGamesReqd & " and warid=" & iWarID, dbconnection, adopenstatic, adlockoptimistic
do until(rsPlayer.EOF)
iGamesRT = rsplayer("gamesplayed").value
iVictoryRT = rsplayer("victoryrt").value
iAPPG = rsplayer("appg").value
iTotUPPRT = rsplayer("upp").value
iTotAENPTS = rsplayer("aenpts").value
if cdbl(iMaxGamesRT) <> cdbl(iMinGamesRT) then
rsplayer("gamesplayedranking").value = ((9.00/(cdbl(iMaxGamesRT)-cdbl(iMinGamesRT)))*(cdbl(iGamesRT)-cdbl(iMinGamesRT)))+1
else
rsplayer("gamesplayedranking").value = 10.00
end if
if cdbl(iMaxVictoryRT) <> cdbl(iMinVictoryRT) then
rsplayer("victoryrtranking") = ((24.00/(cdbl(iMaxVictoryRt)-cdbl(iMinVictoryRt)))*(cdbl(iVictoryRT)-cdbl(iMinVictoryRt)))+1
else
rsplayer("victoryrtranking") = 25.00
end if
if cdbl(iMaxAENPTS) <> cdbl(iMinAENPTS) then
rsplayer("aenptsranking") = (24.00-((24.00/(cdbl(iMaxAENPTS)-cdbl(iMinAENPTS)))*(cdbl(iTotAENPTS)-cdbl(iMinAENPTS))))+1
else
rsplayer("aenptsranking") = 25.00
end if
if cdbl(iMaxAPPG) <> cdbl(iMinAPPG) then
rsplayer("appgranking") = ((24.00/(cdbl(iMaxAPPG)-cdbl(iMinAPPG)))*(cdbl(iAPPG)-cdbl(iMinAPPG)))+1
else
rsplayer("appgranking") = 25.00
end if
if cdbl(iMaxUPP) <> cdbl(iMinUPP) then
rsplayer("uppranking") = ((14.00/(cdbl(iMaxUPP)-cdbl(iMinUPP)))*(cdbl(iTotUPPRT)-cdbl(iMinUPP)))+1
else
rsplayer("uppranking") = 15.00
end if
rsplayer("ranking") = cdbl(rsplayer("gamesplayedranking")) + _
cdbl(rsplayer("victoryrtranking")) + _
cdbl(rsplayer("appgranking")) + _
cdbl(rsplayer("aenptsranking")) + _
cdbl(rsplayer("uppranking"))
rsPlayer.Update
rsplayer.movenext
loop
rsPlayer.Close
Still same error at 'rsPlayer.Update'.
Yeah, I knew it would. I haven't changed anything but that code block will be easier to troubleshoot without all the commented out junk.
I would start by commenting out rsPlayer.Update (to stop it from erroring) and Response.Write out a bunch of the variables in that block to see what's going on.