tnok85 Posted January 29, 2011 Posted January 29, 2011 #include <Array.au3> Local $avArray[11] = [1, 5, 1, 7, 66, 12, 1, 66, 11, 5, 1] MsgBox(0,'Min Index Numeric value', _ArrayMinIndex($avArray, 1)) MsgBox(0,'Max Index Numeric value', _ArrayMaxIndex($avArray, 1)) It seems to only return the first min and first max. (Min shows 0, max shows 4) I'd like to have it show you *all* minimums and *all* maximums if there is more than one min or max.
KaFu Posted January 29, 2011 Posted January 29, 2011 Then wrap the functions in an enumeration: #include <Array.au3> Local $avArray[11] = [1, 5, 1, 7, 66, 12, 1, 66, 11, 5, 1] Local $i_ArrayMin = $avArray[_ArrayMinIndex($avArray, 1)] For $i = 0 To UBound($avArray) - 1 If $avArray[$i] = $i_ArrayMin Then ConsoleWrite("Min " & $i_ArrayMin & " found at " & $i & @CRLF) Next Local $i_ArrayMax = $avArray[_ArrayMaxIndex($avArray, 1)] For $i = 0 To UBound($avArray) - 1 If $avArray[$i] = $i_ArrayMax Then ConsoleWrite("Max " & $i_ArrayMax & " found at " & $i & @CRLF) Next OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now