Adolfik 0 Posted July 23, 2010 I couldn't find it anywhere ;/ so I need to ask here I got few values like $1,$2,$3 all are just numbers and I need to find which one of them is the biggest one. Thanks Share this post Link to post Share on other sites
Melba23 3,456 Posted July 23, 2010 Adolfik,How about putting the values into an array and using _ArrayMax? I couldn't find it anywhereIt is in the Help file! M23 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 Share this post Link to post Share on other sites
ClayB 0 Posted July 23, 2010 How are the values stored? Excel spreadsheet, text file, data structure (array, linked list, etc)? If it is in a text file, is there any other data in the file? Share this post Link to post Share on other sites
cageman 4 Posted July 23, 2010 simple way is with if statements. if $1>=$2 and $1>=$3 Then $max=$1; elseif $2>=3 Then $max=$2; else $max=$3; endif Share this post Link to post Share on other sites
Pottery 0 Posted July 23, 2010 Examples #include <Array.au3> Dim $Array[4] $Array[0] = 4 $Array[1] = 9 $Array[2] = 1 $Array[3] = 5 MsgBox(64, 'Example #1', 'The biggest value is ' & _ArrayMax($Array) & '.') #include <Array.au3> Dim $Array[4] $Array[0] = 4 $Array[1] = 9 $Array[2] = 1 $Array[3] = 5 _ArrayDisplay($Array) #include <Array.au3> Dim $Array[4] For $i = 0 to 3 $Array[$i] = Random(0, 99) Next MsgBox(64, 'Example #3', 'The biggest value is ' & _ArrayMax($Array) & '.') _ArrayDisplay($Array) Share this post Link to post Share on other sites
koman92040 0 Posted June 23, 2012 Is there any way to do this with a mufti denominational array, using only one collum? Share this post Link to post Share on other sites
water 2,387 Posted June 23, 2012 "mufti denominational array"? Or do you mean a "multi dimensional array"? BTW: You necro a thread that is nearly 2 years old. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
koman92040 0 Posted June 24, 2012 pardon my spelling "multi dimensional array" here's what i'm doing, I'm using one array to store The Hostame, IP address and Ping response time in a 2 dimensional array (5 by 3) then bases on the Ping response value launch a remote assistance session. So far I haveTCPStartup() $input = InputBox(@ScriptName, "Hostname:",) If @error Then TCPShutdown() Exit EndIf $hostname = StringStripWS($input, 8) Dim $ping[5][3] = [[4],[$hostname],[$hostname & ".example.com"],[$hostname & ".in.example.com"],[$hostname & ".corp.in.example.com"]] While 1 For $loop = 1 To $ping[0][0] $ping[$loop][1] = TCPNameToIP($ping[$loop][0]) $ping[$loop][2] = Ping($ping[$loop][1]) Next For $loop = 1 To $ping[0][0] If $ping[$loop][2] Then TrayTip("Launching Connection", "Remote Assistance is launching a connection to " & $ping[$loop][0] & " at " & $ping[$loop][1] & " wich responded in " & $ping[$loop][2] & "ms", 30) Run("msra.exe /offerra " & $ping[$loop][1]) ExitLoop EndIf Next WEnd TCPShutdown()but right now it users the first pingable FQDN, i want the fastest responding FQDN.I realize this is an old post, i goggled and found this topic and thought it was applicable to what i'm doing. If Share this post Link to post Share on other sites
water 2,387 Posted June 24, 2012 (edited) I would use something like this to use the fastest connection: $input = InputBox(@ScriptName, "Hostname:",) If @error Then Exit TCPStartup() $hostname = StringStripWS($input, 8) Global $ping[5][3] = [[4],[$hostname],[$hostname & ".example.com"],[$hostname & ".in.example.com"],[$hostname & ".corp.in.example.com"]] Global $iFastestValue = 9999999999999, $iFastestIndex = 0 While 1 For $loop = 1 To $ping[0][0] $ping[$loop][1] = TCPNameToIP($ping[$loop][0]) $ping[$loop][2] = Ping($ping[$loop][1]) If $ping[$loop][2] > 0 And $ping[$loop][2] < $iFastestValue Then $iFastestValue = $ping[$loop][2] $iFastestIndex = $loop EndIf Next TrayTip("Launching Connection", "Remote Assistance is launching a connection to " & $ping[$iFastestIndex][0] & " at " & $ping[$iFastestIndex][1] & " wich responded in " & $ping[$iFastestIndex][2] & "ms", 30) Run("msra.exe /offerra " & $ping[$iFastestIndex][1]) ExitLoop WEnd TCPShutdown() Edited June 24, 2012 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
water 2,387 Posted June 25, 2012 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites