Thread: [Guide] Scripting in Essentials 101
View Single Post
  #8    
Old December 11th, 2012 (10:47 AM).
Luka S.J.'s Avatar
Luka S.J.
S.J.Ware HD
 
Join Date: Dec 2008
Age: 21
Gender: Male
Nature: Adamant
Quote originally posted by Musketeer:
And I think venom12 meant that since if $Trainer.party.length>=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