Last active
January 11, 2018 01:56
-
-
Save TLMcode/10c994d735afce5e7171ce2e58fe00ab to your computer and use it in GitHub Desktop.
Push Values To Object Array Keys Correctly in AHk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SDDir = C:\some_directory ; some example directory | |
FilePropObj := { name : [], size : [], file : [ { name : "", size : "" } ] } | |
FileObj := [ { name : "", size : "" } ] | |
Loop, Files, % SDDir "\*", R | |
{ | |
FileObj[ a_index , "name" ] := A_LoopFileName | |
FileObj[ a_index , "size" ] := A_LoopFileSize | |
FilePropObj.file[ a_index , "name" ] := A_LoopFileName | |
FilePropObj.file[ a_index , "size" ] := A_LoopFileSize | |
FilePropObj.name.push( A_LoopFileName ), FilePropObj.size.push( A_LoopFileSize ) | |
; msgbox % FileObj[ a_index ].name " <> " FileObj[ a_index ].size "`n--------`n" | |
; . FilePropObj.file[ a_index ].name " <> " FilePropObj.file[ a_index ].size "`n--------`n" | |
; . FilePropObj.name[ a_index ] " <> " FilePropObj.size[ a_index ] | |
} | |
For Each, File in FileObj | |
msgbox % Each " <> " FileObj.Length() " <> " File.name " <> " | |
. FileObj[ Each ].name " <> " File.size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment