Thread: [Guide] Scripting in Essentials 101
View Single Post
Old December 11th, 2012 (10:47 AM).
Luka S.J.'s Avatar
Luka S.J. Luka S.J. is offline
Jealous Croatian
    Join Date: Dec 2008
    Location: Croatia
    Age: 24
    Gender: Male
    Nature: Adamant
    Posts: 1,106
    Originally Posted by Musketeer View Post
    And I think venom12 meant that since if $>=1 checks for Pokémon number 1, in the code 1 basically means 2, and 0 means 1. That would make the code actually search for the second Pokémon in the party, not the first since the first is 0. Although, if they function the way you describe, then there should be no problem.
    The symbol > stands for greater than, while >= is for greater than or equal to. By that logic, if we do >0 or >=1 the minimum number will be the same, 1. And since when you have a Pokemon in your party, the lowest number your party can have is 1. There is a difference between indexes and length of arrays, one being that the first index in an array is always 0, and that the minimum positive (non nil) length of an array is 1.

    Lol, ninja'd.

    Reply With Quote