Jump to content

Loop a complete list instead of indiviually items


Go to solution Solved by donnyh13,

Recommended Posts

Posted (edited)

Hello,

I do hope that I have titled this query correctly?

I have the following script that confirms the modified dates of a number of data files - implementing FileGetTime.

However, each item is being displayed "one-after-the-other". What I require is a complete file listing! Here is the script:
 

Spoiler
; -----------------------------------------------
; 9/8/2026 11:55:44 AM
; -----------------------------------------------
#include "ExtMsgBox.au3"
#include <FileConstants.au3>
; -----------------------------------------------
Opt("MustDeclareVars", 1)
;~ Opt("MouseCoordMode", 0)
; -----------------------------------------------
Global $iEMBWidth = 1000
Global $iMsgDelay = 2
; ---------------------
Global $sAC_DAPath = "D:\App_Config\Digital_Audio"
Global $sMainBUPath = "E:\Backups"
; -----------------------------------------------
DrvGBU()
; -----------------------------------------------
Func DrvGBU()
    DriveGBU()
    ConfirmFileDates()
EndFunc   ;==>DrvGBU
; -----------------------------------------------
Func DriveGBU()
    Local $sSrcDataPath, $sDstDataPath, $sResult = ""
    Local $aSrcData[] = [ _
            "G:\CHT_Files", _
            "G:\ControlTrack_Data", _
            "G:\F-Key_Data", _
            "G:\Mix_Templates", _
            "G:\Prf_Data", _
            "G:\Scene_Data", _
            "G:\Session_Data", _
            "G:\Session_Master"]
    ; ---------------------
    Local $aDstData[] = [ _
            $sMainBUPath & "\App_Config\DriveG\CHT_Files", _
            $sMainBUPath & "\App_Config\DriveG\ControlTrack_Data", _
            $sMainBUPath & "\App_Config\DriveG\F-Key_Data", _
            $sMainBUPath & "\App_Config\DriveG\Mix_Templates", _
            $sMainBUPath & "\App_Config\DriveG\Prf_Data", _
            $sMainBUPath & "\App_Config\DriveG\Scene_Data", _
            $sMainBUPath & "\App_Config\DriveG\Session_Data", _
            $sMainBUPath & "\App_Config\DriveG\Session_Master"]
    ; -----------------------------------------------
    For $i = 0 To UBound($aSrcData) - 1
        $sSrcDataPath = $aSrcData[$i]
        $sDstDataPath = $aDstData[$i]
        ; ---------------------
        $sResult &= $i + 1 & "] ..." & $sSrcDataPath & (DirCopy($sSrcDataPath, $sDstDataPath, $FC_OVERWRITE + $FC_CREATEPATH) ? "...Yes      " : "...No      ") & @CRLF
;~      ConsoleWrite("From: " & $sSrcDataPath & " ====>>>> To: " & $sDstDataPath & @CRLF)
    Next
    ; -----------------------------------------------
    _ExtMsgBoxSet(64, 4, Default, Default, 14, "Segoe UI Semibold", $iEMBWidth)
    _ExtMsgBox(48, " ", " Copy file data...", $sResult, $iMsgDelay)
EndFunc   ;==>DriveGBU
; -----------------------------------------------
Func ConfirmFileDates()
    Local $aFiles[14] = [ _
            "G:\F-Key_Data\1_SAW_Empty.fky", _
            "G:\F-Key_Data\2_SAW_Alt_Empty.fky", _
            "G:\F-Key_Data\3_SAC_Empty.fky", _
            "G:\F-Key_Data\4_SAC_Alt_Empty.fky", _
            "G:\F-Key_Data\5_SAW_3CH_Mix.fky", _
            "G:\F-Key_Data\6_SAC_6CH_Mix.fky", _
            "G:\Mix_Templates\1_SAW_3CH_Mix.mxt", _
            "G:\Mix_Templates\2_SAC_6CH_Mix.mxt", _
            "G:\Mix_Templates\3_SAW_Upated.mxt", _
            "G:\Mix_Templates\4_SAC_Updated.mxt", _
            "G:\Prf_Data\SAC64.prf", _
            "G:\Prf_Data\SAWStudio64.prf", _
            "G:\Session_Master\Session_Master.edl", _
            "G:\Session_Master\Session_Master.mxs"]
    ; -----------------------------------------------
    For $i = 0 To UBound($aFiles) - 1
        Local $tFileTime = FileGetTime($aFiles[$i])
        Local $sMsg = _
                $aFiles[$i] & ", " & $tFileTime[3] & ":" & $tFileTime[4] & ":" & $tFileTime[5] & ", " & _
                $tFileTime[1] & "/" & $tFileTime[2] & "/" & $tFileTime[0] & "      "
        ; -----------------------------------------------
        _ExtMsgBoxSet(64, 4, Default, Default, 14, "Segoe UI Semibold", $iEMBWidth)
        _ExtMsgBox(64, " ", " File Modified Date!", $sMsg, $iMsgDelay)
    Next
EndFunc   ;==>ConfirmFileDates
; -----------------------------------------------

 

Any assistance would be greatly appreciated!

Edited by mr-es335
  • Solution
Posted

If I understand what you are looking for, this is how I would do it.

Func ConfirmFileDates()
    Local $aFiles[14] = [ _
            "G:\F-Key_Data\1_SAW_Empty.fky", _
            "G:\F-Key_Data\2_SAW_Alt_Empty.fky", _
            "G:\F-Key_Data\3_SAC_Empty.fky", _
            "G:\F-Key_Data\4_SAC_Alt_Empty.fky", _
            "G:\F-Key_Data\5_SAW_3CH_Mix.fky", _
            "G:\F-Key_Data\6_SAC_6CH_Mix.fky", _
            "G:\Mix_Templates\1_SAW_3CH_Mix.mxt", _
            "G:\Mix_Templates\2_SAC_6CH_Mix.mxt", _
            "G:\Mix_Templates\3_SAW_Upated.mxt", _
            "G:\Mix_Templates\4_SAC_Updated.mxt", _
            "G:\Prf_Data\SAC64.prf", _
            "G:\Prf_Data\SAWStudio64.prf", _
            "G:\Session_Master\Session_Master.edl", _
            "G:\Session_Master\Session_Master.mxs"]
    Local $tFileTime
    Local $sMsg = "" ; Make sure this is declared with a blank string so you can Concatenate.
    ; -----------------------------------------------
    For $i = 0 To UBound($aFiles) - 1
        $tFileTime = FileGetTime($aFiles[$i])
        $sMsg &= _
                $aFiles[$i] & ", " & $tFileTime[3] & ":" & $tFileTime[4] & ":" & $tFileTime[5] & ", " & _
                $tFileTime[1] & "/" & $tFileTime[2] & "/" & $tFileTime[0] & "      " & @CRLF & @CRLF ; Add spacing between each result.
        ; -----------------------------------------------
    Next
        _ExtMsgBoxSet(64, 4, Default, Default, 14, "Segoe UI Semibold", $iEMBWidth)
        _ExtMsgBox(64, " ", " File Modified Date!", $sMsg, $iMsgDelay)
EndFunc   ;==>ConfirmFileDates

And for added readability:

Spoiler
Func ConfirmFileDates()
    Local Enum $eYear, $eMonth, $eDay, $eHour, $eMin, $eSec
    Local $aFiles[14] = [ _
            "G:\F-Key_Data\1_SAW_Empty.fky", _
            "G:\F-Key_Data\2_SAW_Alt_Empty.fky", _
            "G:\F-Key_Data\3_SAC_Empty.fky", _
            "G:\F-Key_Data\4_SAC_Alt_Empty.fky", _
            "G:\F-Key_Data\5_SAW_3CH_Mix.fky", _
            "G:\F-Key_Data\6_SAC_6CH_Mix.fky", _
            "G:\Mix_Templates\1_SAW_3CH_Mix.mxt", _
            "G:\Mix_Templates\2_SAC_6CH_Mix.mxt", _
            "G:\Mix_Templates\3_SAW_Upated.mxt", _
            "G:\Mix_Templates\4_SAC_Updated.mxt", _
            "G:\Prf_Data\SAC64.prf", _
            "G:\Prf_Data\SAWStudio64.prf", _
            "G:\Session_Master\Session_Master.edl", _
            "G:\Session_Master\Session_Master.mxs"]
    Local $tFileTime
    Local $sMsg = "" ; Make sure this is declared with a blank string so you can Concatenate.
    ; -----------------------------------------------
    For $i = 0 To UBound($aFiles) - 1
        $tFileTime = FileGetTime($aFiles[$i])
        $sMsg &= _
                $aFiles[$i] & ", " & $tFileTime[$eHour] & ":" & $tFileTime[$eMin] & ":" & $tFileTime[$eSec] & ", " & _
                $tFileTime[$eMonth] & "/" & $tFileTime[$eDay] & "/" & $tFileTime[$eYear] & "      " & @CRLF & @CRLF ; Add spacing between each result.
        ; -----------------------------------------------
    Next
        _ExtMsgBoxSet(64, 4, Default, Default, 14, "Segoe UI Semibold", $iEMBWidth)
        _ExtMsgBox(64, " ", " File Modified Date!", $sMsg, $iMsgDelay)
EndFunc   ;==>ConfirmFileDates

 

 

LibreOffice UDF  

Scite4AutoIt Spell-Checker Using LibreOffice

WPS Office adapter — Use MS Word UDFs with WPS Office!

LibreOffice API Inspector tools

Spoiler

"Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions."

Posted

No problem @mr-es335,

Glad it helped. Yes, it was a simple fix this time ;)

Best regards,

Donny

LibreOffice UDF  

Scite4AutoIt Spell-Checker Using LibreOffice

WPS Office adapter — Use MS Word UDFs with WPS Office!

LibreOffice API Inspector tools

Spoiler

"Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions."

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
×
×
  • Create New...