Majedz Posted February 15, 2021 Share Posted February 15, 2021 For $i=1 to 50 $result Sleep(200) Next Is their a way to compare the $result in iteration number 50 with the $result in iteration number 49 and 48,47 ; I mean if the $result in iteration number 50> or < than previous values Thanks, in advance Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 15, 2021 Moderators Share Posted February 15, 2021 Majedz, Store the current min and max values to compare: #include <MsgBoxConstants.au3> ; Set placeholders $iMin = 9999 $iMax = 0 For $i = 1 To 50 ; get an integer between 0 and 100 $iResult = Random(0, 100, 1) If $iResult < $iMin Then MsgBox($MB_SYSTEMMODAL, "New Min", $iResult) $iMin = $iResult ElseIf $iResult > $iMax Then MsgBox($MB_SYSTEMMODAL, "New Max", $iResult) $iMax = $iResult EndIf Next MsgBox($MB_SYSTEMMODAL, "End:", "Max: " & $iMax & @CRLF & "Min:" & $iMin) M23 Majedz 1 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Majedz Posted February 15, 2021 Author Share Posted February 15, 2021 Thanks Melba23, for your reply, I have to try it and practice more, can I retrieve result values of iteration number 48, 45, 43…… for example Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 15, 2021 Moderators Share Posted February 15, 2021 Majedz, If you want to store all the values then just place them in an array as you generate them: #include <Array.au3> Global $aResults[50] For $i = 1 To 50 ; get an integer between 0 and 100 $aResults[$i - 1] = Random(0, 100, 1) Next _ArrayDisplay($aResults, "", Default, 8) Now you can play with them as much as you wish. It would be helpful if you could give us some idea of why you are asking these min/max questions - if we knew just what you are trying to do we might be able to offer some more focused advice. M23 Majedz 1 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Majedz Posted February 15, 2021 Author Share Posted February 15, 2021 Thanks again Melba23, for your kind reply, for sure its very helpful for me, since English is not my mother language I will summarize what I am doing and return back, looking for your help. Link to comment Share on other sites More sharing options...
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