Author Topic: Unknown Error with script  (Read 618 times)

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Unknown Error with script
« Reply #15 on: December 21, 2010, 10:33:52 pm »


               

Dylmani555 wrote...

That was why I WAS using quick reply, it separates the lines, rather than my first post.


The problem there was not the codebox or the lack of quick reply, it was the original formatting of the script you posted. See the script in my reply for what a properly formatted codeboxed script looks like (notice the preserved indents).

Funky
               
               

               


                     Modifié par FunkySwerve, 21 décembre 2010 - 10:34 .
                     
                  


            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Unknown Error with script
« Reply #16 on: December 22, 2010, 01:04:48 am »


               

Dylmani555 wrote...

ent.devil wrote...
One other thing it seems that you are doing something like this:

if () {
}
if () {
}
if () {
} else {
}

when you could do with something like this otherwise a class that matches an earlier value will be altered by that last else block:

if () {
} else if () {
} else if () {
} else if () {
} else {
}


I take it you would prefer to use the second method shown here as it will only check the later classes if the earlier ones show false, but as it is only checking the first class, only 1 can be true.'^_^'

Actually, if you don't use the "else" the script will run every "if" statement even after one has returned true. It's a minor adjustment but it makes a bigger difference in larger scripts.

-420