Func _SwapBoolean(ByRef $Bool) if $Bool Then $Bool = False Else $Bool = True EndIf EndFunc Func _GetRandom($Arr,$iStart=0, $iEnd=0) local $i, $n, $Str_Random if $iEnd =0 Then $n = UBound($Arr)-1 Else $n = $iEnd EndIf $i = Random($iStart, $n, 1) $Str_Random = $Arr[$i] ;~ ConsoleWrite(@lf&"$Str_Random="&$Str_Random) return $Str_Random EndFunc ;==> _GetRandom Func _FillArrayFileSearch(ByRef $FillArray, $SearchDir, $SearchPattern) Local $search Local $x Local $file ReDim $FillArray[1] ; Shows the filenames of all files in the current directory, note that "." and ".." are returned. $search = FileFindFirstFile($SearchDir & "\" & $SearchPattern) ; Check if the search was successful If $search = -1 Then ;MsgBox(0, "Fehler", "Keine Dateien/Ordner in " & $SearchDir & " gefunden") Return $FillArray Exit EndIf $x = 0 ;Elementnummer in Array While 1 $file = FileFindNextFile($search) If @error Then ExitLoop _ArrayAdd($FillArray, $file) WEnd ;_ArrayDisplay( $FillArray, "Whole array" ) ; Close the search handle FileClose($search) ;MsgBox(4096,"Array gefüllt", StrArrayElements($FillArray)) ;die Meldung klappt Return $FillArray EndFunc ;==> _FillArrayFileSearch Func _ShowTempSubFolders($FolderObject,$Folder) ;Searches for unique subfolder strings in @TempDir ; e.g.: when C:/temp and C:/temp/sth occurs, then C:/temp will be discarded For $Subfolder In $FolderObject.SubFolders ;msgbox(0,"",$Folders[UBound($Folders)-2]&"\") if StringInStr($Subfolder.Path,$Arr_UniqueFolders[UBound($Arr_UniqueFolders)-1]&"\")>0 Then ;Redim $Structure[UBound($Structure)+1] ;$Structure[UBound($Structure)-1] = $Folders[UBound($Folders)-1] $Arr_UniqueFolders[UBound($Arr_UniqueFolders)-1] = StringMid($Subfolder.Path,StringLen($Folder)+1) Else Redim $Arr_UniqueFolders[UBound($Arr_UniqueFolders)+1] $Arr_UniqueFolders[UBound($Arr_UniqueFolders)-1] = StringMid($Subfolder.Path,StringLen($Folder)+1) EndIf _ShowTempSubFolders($Subfolder,$Folder) Next EndFunc ;==> _ShowSubFolders