Moderators Melba23 Posted June 11, 2012 Moderators Share Posted June 11, 2012 Raffav, So what have you tried that has not worked? 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 Link to comment Share on other sites More sharing options...
Raffav Posted June 11, 2012 Author Share Posted June 11, 2012 i dont have no idea where to stat, i am makes some logical gess, PS: the msgbox is for try to understand. #include <File.au3> #include <Array.au3> ;~ $dirPath = "C:UsersMarkoDesktoptest" $fileArray = _FileListToArray(@ScriptDir,"*",1) $fileSize = 0 $fileName = "" $size = 1e10 ; Set a big number to start with Local $fileSize[100] For $i = 1 to UBound($fileArray) - 1 $fileSize[$i] = FileGetSize($fileArray[$i]) If $fileSize[$i] < $size Then ; Now see if this file is even smaller $size = $fileSize[$i] $fileName = $fileArray[$i] EndIf Next MsgBox(0, "Smallest file", "Smallest file is " & $fileName &" aaa "&$fileSize[1]&" aaa "&$fileSize[2]&" aaa "&$fileSize[3]&" aaa "&$fileSize[4]&" aaa "&$fileSize[5]) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 11, 2012 Moderators Share Posted June 11, 2012 Rafav, In other words - nothing. OK, the last time you get a freebie for a while: #include <File.au3> #include <Array.au3> ; List the files $aFileArray = _FileListToArray(@ScriptDir, "*.*", 1) ; Create a 2D array to hold the sizes and the names Global $aFileSize[$aFileArray[0] + 1][2] = [[$aFileArray[0], 0]] ; Run through teh files and add the size and name to the 2D array For $i = 1 To UBound($aFileArray) - 1 $aFileSize[$i][0] = FileGetSize(@ScriptDir & "" & $aFileArray[$i]) $aFileSize[$i][1] = $aFileArray[$i] Next ; Sort the 2D array on the size column _ArraySort($aFileSize, 1, 1) ; And here is the result! _ArrayDisplay($aFileSize) All clear? 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 Link to comment Share on other sites More sharing options...
Raffav Posted June 11, 2012 Author Share Posted June 11, 2012 How i said i didn't know where to start, principality arrays functions Thanks for the help again have nice day Link to comment Share on other sites More sharing options...
Raffav Posted June 27, 2012 Author Share Posted June 27, 2012 (edited) Helloi know that is freebie, but i trying to figure out how this part work principally in the Global and how it link the Name with the Size i think that is made in the For loop but i cant "Visualize it"i figure out that the $aFileArray will hold the names one per index numbuer (dont know that is the correct name)$aFileArray[0] ;= number of file/folder$aFileArray[1] ;= 1 name file i dont figure out the order for indexing$aFileArray[2] ;= 2 name file.....$aFileArray[N] ;= last namefile-----------------------------------------------------------------supposing that have 4 files in directorythe global will read +/- something like that:Global $aFileSize[4 + 1][2] = [[5], 0]] is that logical right??; Create a 2D array to hold the sizes and the names Global $aFileSize[$aFileArray[0] + 1][2] = [[$aFileArray[0], 0]] ; Run through teh files and add the size and name to the 2D array For $i = 1 To UBound($aFileArray) - 1 $aFileSize[$i][0] = FileGetSize(@ScriptDir & "" & $aFileArray[$i]) $aFileSize[$i][1] = $aFileArray[$i] NextThanksSorry for bad English Edited June 27, 2012 by Raffav 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