Jump to content

min/max - (Moved)


Majedz
 Share

Recommended Posts

hi, any short version for to chثck if $L0 or $L1 is min:

If $L0=$L0 and $L0<$L1 and $L0<$L2 and $L0<$L3 and $L0<$L4 and $L0<$L5 and $L0<$L6 and $L0<$L7 and $L0<$L8 and $L0<$L9 and $L0<$L10 Then MsgBox("", "L0 is min",$L0,5)
If $L1<$L0 and $L1=$L1 and $L1<$L2 and $L1<$L3 and $L1<$L4 and $L1<$L5 and $L1<$L6 and $L1<$L7 and $L1<$L8 and $L1<$L9 and $L1<$L10 Then MsgBox("", "L1 is min",$L1,5)

Link to comment
Share on other sites

  • Moderators

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

Majedz,

No problem. Welcome to the AutoIt forums.

As a possible solution, put all the values into an array and use _ArrayMin to determine the lowest.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

my problem Melba23 is I don’t know how to put my variables (values) into an array ; it works without using array, but very long (bad code),

First step in my work (is done, no problems) I am reading 11 low and high  values,  from specified location of screen, by moving the mouse on a graph and reading High/Low data (using PixelChecksum function OCR /Copied and modified from an old post in this forum, and working well)

the result is reading Low/ high values :

 $L0,$L1,$L2, ,$L3……,$L10 and SH0,$H1, $H2, ,$H3,…… ,$H10

Second step: is manipulating low/high data to get for example the min of the 11 Lows or max of highs….etc

I go through help files regarding arrays but I am missing something, how to contract the 11 lows, 11 highs and Low variables  array,

any help is highly appreciated

Link to comment
Share on other sites

 

32 minutes ago, Majedz said:

I go through help files regarding arrays but I am missing something, how to contract the 11 lows, 11 highs and Low variables  array,

any help is highly appreciated

#include <Array.au3>

; Testdata :
Local $L0=3120, $L1=2120, $L2=131, $L3=923, $L4=8120, $L5=520, $L6=5120, $L7=6120, $L8=3120, $L9=4120, $L10=5120

Local $aLowValues[11] = [$L0,$L1,$L2,$L3,$L4,$L5,$L6,$L7,$L8,$L9,$L10]

_ArrayDisplay($aLowValues) ; *** just for display
MsgBox(0, "", "minimum Value = " & _ArrayMin($aLowValues,0) & @CRLF & "minimum Index = " & _ArrayMinIndex($aLowValues,0), 5)

_ArraySort($aLowValues, 0)
_ArrayDisplay($aLowValues) ; *** just for display

 

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...