Thread: Array help
View Single Post
  #10  
Old 08-29-2011, 11:39 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
You could use the modulo operator for this one.
PHP Code:
this.selectedid = (this.selectedid 1) % this.rights.size(); 
Should also work for "scrolling" in the other direction. No need for a loop either. Just check the key code and do that.
Reply With Quote