hi,
i've this array :
Array:Val[30]
i want to know the max value in this array
I would like to avoid lopping it with a for
(for counter=0 to 29......)..
How i find max value in array? thank
max value in array [SOLVED]
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: max value in array [SOLVED]
turbofib,
using Array_Sort you can sort the array in descending order. If you need to keep the original order in the array make a copy first with Array_Copy and then sort the copy.
Regards,
ABC
using Array_Sort you can sort the array in descending order. If you need to keep the original order in the array make a copy first with Array_Copy and then sort the copy.
Regards,
ABC
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: max value in array
I agree, when you are looking for code performance the for loop will be faster. Depending on how the array is filled (and as you know the values you use to fill it), you might even save more time by just performing the loop in case the value that drops out is equal to the current highest value in the array.
Regards,
ABC
Regards,
ABC