Web Analytics Made Easy -
StatCounter scripts confusing the number order - CodingForum

Announcement

Collapse
No announcement yet.

scripts confusing the number order

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • scripts confusing the number order

    Hi again all,

    I'm having a little difficulty with this part of my script:

    if (adoRS("Score1")) >= (txt) then submitData = "false"

    end if

    if submitData = "true" then

    adoRS("Score1") = txt
    adoRS.Update
    adoRS.Requery

    response.write ("submitData=true")
    else
    response.write ("submitData=false")

    end if


    I'm basically trying to see whether the value in the database(Score1) is greater than the one thats trying to be submitted (txt) if it is then don't add it if it isn't add the new score.

    This code works ok up until 9 but then somehow thinks 10, 11, 12 etc are smaller than other numbers from 1 to 9.

    can anyone see something wrong that i've missed.

    Thanks In advance,

    Russ

  • #2
    try converting the numbers to integers first
    Code:
    if CInt(adoRS("Score1")) >= CInt(txt) then submitData = "false"

    Comment


    • #3
      That works perfectly now, thanks a lot mehere!

      Russ

      Comment

      Working...
      X