xbennY0 Posted November 10, 2014 Author Share Posted November 10, 2014 (edited) xbennY0, If all you requires is all the data in one file, then what I suggested in post #16 above should be what you need. M23 is it possible save a struct in autoit like c++ containing all data in one single file? or create multiple structs like: Local Const $Struct1 = "struct;" & _ "char var1[128];" & _ "byte var2;" & _ "uint var3;" & _ "char var4[128];" & _ "endstruct" Local $tSTRUCT1[50] = DllStructCreate($Struct1) Edited November 10, 2014 by xbennY0 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 10, 2014 Moderators Share Posted November 10, 2014 xbennY0,You can add the data from each file to the master file as you loop through them - there is no need to use a struct. 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...
xbennY0 Posted November 10, 2014 Author Share Posted November 10, 2014 (edited) bennY0, You can add the data from each file to the master file as you loop through them - there is no need to use a struct. M23 Interesting! how can i do this using the _FileListToArrayRec? Edited November 10, 2014 by xbennY0 Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted November 10, 2014 Moderators Solution Share Posted November 10, 2014 xbennY0,Somehow I knew you would ask that: Here is a short example which just looks for 2 files in the AutoIt Include folder and adds them to a single file:#include <File.au3> #include <Array.au3> ; Name of file to create $sFile = @ScriptDir & "\Master File.txt" ; Root path of the folders to seach for files - this gets the current Include folder $sPath = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", Default, -1)) & "Include\" ; You would need to adjust the path so that it returns all the files you want to add to the master file ; Here we are just looking for Process.au3 and ProcessConstants.au3 $aList = _FileListToArrayRec($sPath, "Process*.au3", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_SORT, $FLTAR_FULLPATH) ; These are the files returned - you should have 2 _ArrayDisplay($aList, "", Default, 8) ; We now create the master file $hFile = FileOpen($sFile, 2) ; And loop through the fiel list adding the content with some delimiters so we know where one ends and the next one starts For $i = 1 To $aList[0] $VContent = FileRead($aList[$i]) FileWrite($hFile, $aList[$i] & @CRLF & "----------" & @CRLF & $vContent & @CRLF & "###############################################" & @CRLF & @CRLF) Next ; We close the file FileClose($hFile) ; And now open NotePad to display it ShellExecute($sFile)All clear? M23 xbennY0 1 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...
xbennY0 Posted November 10, 2014 Author Share Posted November 10, 2014 (edited) xbennY0, Somehow I knew you would ask that: Here is a short example which just looks for 2 files in the AutoIt Include folder and adds them to a single file: #include <File.au3> #include <Array.au3> ; Name of file to create $sFile = @ScriptDir & "\Master File.txt" ; Root path of the folders to seach for files - this gets the current Include folder $sPath = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", Default, -1)) & "Include\" ; You would need to adjust the path so that it returns all the files you want to add to the master file ; Here we are just looking for Process.au3 and ProcessConstants.au3 $aList = _FileListToArrayRec($sPath, "Process*.au3", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_SORT, $FLTAR_FULLPATH) ; These are the files returned - you should have 2 _ArrayDisplay($aList, "", Default, 8) ; We now create the master file $hFile = FileOpen($sFile, 2) ; And loop through the fiel list adding the content with some delimiters so we know where one ends and the next one starts For $i = 1 To $aList[0] $VContent = FileRead($aList[$i]) FileWrite($hFile, $aList[$i] & @CRLF & "----------" & @CRLF & $vContent & @CRLF & "###############################################" & @CRLF & @CRLF) Next ; We close the file FileClose($hFile) ; And now open NotePad to display it ShellExecute($sFile) All clear? M23 Got it! You are the best! but i think this is not the best choice...is it possible put all this files in my .exe using the Resource UDF making it readable after? I'm sorry for so many questions Edited November 10, 2014 by xbennY0 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 10, 2014 Moderators Share Posted November 10, 2014 xbennY0, is it possible put all this files in my .exe using the Resource UDF making it readable after?And where did this part of the overall requirement come from? I hate people continually changing the goalposts as the thread progresses, so either I get an explanation of what exactly you are trying to do or that is as far as my help goes. 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...
xbennY0 Posted November 10, 2014 Author Share Posted November 10, 2014 xbennY0, And where did this part of the overall requirement come from? I hate people continually changing the goalposts as the thread progresses, so either I get an explanation of what exactly you are trying to do or that is as far as my help goes. M23 Sorry... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 10, 2014 Moderators Share Posted November 10, 2014 xbennY0,Apology accepted. So are you going to tell us? 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...
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