View Single Post
  #4  
Old 12-16-2007, 05:26 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Googi View Post
That just returns the value of the variable with the lowest value, not the name of the variable. I'd still have to check every variable to see if it matches that value.

EDIT: Came up with a way to do it:

PHP Code:
temp.lowest=999999;
temp.arrayvalue 0;
for (
i:temp.array) {
  if (
i<temp.lowest) {
    
temp.lowest i;
    
temp.lowestposition temp.arrayvalue;
  }
  
temp.arrayvalue++;

Gives the lowest value and its position in the array, which is pretty much just as good since each variable's array position is known.
HOW2SCRIPT
__________________
Reply With Quote