Sign in to follow this  
Followers 0
scila1996

Find the maximum value 1-dimensional array

9 posts in this topic

I have an array ranges from 0 to 10 as follows

Local $a[11] = [25,13,96,16,71,3,9,2,52,30,78]

How to find the largest number in sequence on the array ?

I'm new to programming should expect your help !!! Thank You  :sweating:

Share this post


Link to post
Share on other sites



scila1996,

And I expect you to look in the Help file and see if any function jumps out at you. You are looking for the maximum value in an array - have you tried examining the Array library to see if there is a likely candidate? ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Melba,

Formerly the help for AutoIt3 and UDFs was in 2 separate .chm files
Maybe the OP still uses an old version and encounters difficulties to find 'Array Management' ?

:)

Share this post


Link to post
Share on other sites

Thank ALL ! I I have done successfully

Local $a[11] = [25,13,96,16,71,3,9,2,52,30,78]
Local $max_min[2]; 0 = max <> 1 = min ;
$max_min[0] = $a[0]
For $i = 0 To UBound($a) - 1
    If $a[$i] > $max_min[0] Then
        $max_min[0] = $a[$i]
    EndIf
Next
MsgBox(64,"Dsds",$max_min[0])

Share this post


Link to post
Share on other sites

Do you realize that you're going to drive Melba crazy ?

#include <Array.au3>

Local $a[11] = [25,13,96,16,71,3,9,2,52,30,78]
Msgbox(0,"", _ArrayMax($a, 1) )

:D

Share this post


Link to post
Share on other sites

mikell,

Not crazy, just a little sad when I think of all the time and effort that has been spent on creating that Help file which is often so sadly ignored. :(

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

mikell,

Not crazy, just a little sad when I think of all the time and effort that has been spent on creating that Help file which is often so sadly ignored. :(

M23

Melba23,

I still use the help file until today! Almost for 8 years.

That's why i try not give the fish for them, but i try to teach them how to fish!

Cheers and keep the excelent job!


Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Share this post


Link to post
Share on other sites

Melba,

You shouldn't think of some people ignoring the helpfile, but think of these thousands of users - including myself - who consider it as a must

:)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0