Author Topic: suggestion: HighVal()  (Read 775 times)

0 Members and 1 Guest are viewing this topic.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
suggestion: HighVal()
« on: January 02, 2008, 10:42:06 pm »
I think there should be a function to return the highest value held by an array

function HighVal(arr: array of integer):integer;

say you got this:

MyArray[1]:=1;
MyArray[2]:=2;
MyArray[3]:=750;
MyArray[4]:=4;

HighVal(MyArray) would return 750

is there already a way to do this?
« Last Edit: January 02, 2008, 10:45:03 pm by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: suggestion: HighVal()
« Reply #1 on: January 02, 2008, 10:54:56 pm »
You can do that yourself using a for loop.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: suggestion: HighVal()
« Reply #2 on: January 03, 2008, 09:33:18 am »
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host