Jump to content

Array in arrays - _FileListToArray


elad1223
 Share

Recommended Posts

Hi all,

I am really noobish in autoIT but i am a good programmer. :geek:

the final product i want to do is a treeview of all the batches files and the folders in one folder (which content sub-folders with more batch)

Like a dir command with checkboxes in the batch

I started to do and array of the folders using _FileListToArray

$hTreeView = GUICtrlCreateTreeView(2, 2, 396, 268)
$FolderList=_FileListToArray(@ScriptDir,"*",2)
$NumberOfFolders = $FolderList[0]-1
local $FileListFolder[$NumberOfFolders][10],$TreeView[$NumberOfFolders]

For $x=1 To $NumberOfFolder
MsgBox(0,"test",@ScriptDir & "\"& $FolderList[$x])
$FileListFolder[$x]=_FileListToArray(@ScriptDir & "\"& $FolderList[$x],"*",1)
Next

_GUICtrlTreeView_BeginUpdate($hTreeView)
For $x = 0 To $NumberOfFolders
$TreeView[$x]=GUICtrlCreateTreeViewItem($FolderList[$x], $hTreeView)
For $y = 0 To
GUICtrlCreateTreeViewItem($FileListFolder[$x][$y], $TreeView[$x])
Next
Next
_GUICtrlTreeView_Expand($hTreeView)
_GUICtrlTreeView_EndUpdate($hTreeView)

And I got error in this line:

$FileListFolder[$x]=_FileListToArray(@ScriptDir & "\"& $FolderList[$x],"*",1)

Array variable has incorrect number of subscripts or subscript dimension range exceeded.

I dont know what i did wrong..

Could anyone help me?

Thanks :thumbsup:

-elad

Link to comment
Share on other sites

Try to use instead of _FileListToArray, better managment for folder-file only, subfolder etc.

If you need an helper for the syntax use page__st__180#entry1051894

You using a ready Function to browse. I don't need to browse my way, I just need to see what in my way.

I need to do sort of what you did there just instead of images check-boxes and instead of drives - @ScriptDir.

I could not understand the code so well too many variables .

Where do you put the files inside an Array and insert them to TreeView ?

Thank you both for the quick reply.

I should say that after the user check the check-boxes,

he click a button and all the batches, that the checkbox is checked, will run one after the another.

That the idea.

Again Thank you for the quick reply

Edited by elad1223
Link to comment
Share on other sites

  • Moderators

elad1223,

My ChooseFileFolder UDF (look in my sig for the link) offers you a treeview of a path with user-definable content and display options. It allows you to select items from the tree into an array which you can then loop through - sounds like it might be close to what you want. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

- KaFu

- Holger

- Rasim

Wow!

That exactly what I wanted! Thank you very much ! :D

elad1223,

My ChooseFileFolder UDF (look in my sig for the link) offers you a treeview of a path with user-definable content and display options. It allows you to select items from the tree into an array which you can then loop through - sounds like it might be close to what you want. :)

M23

You are stunning!

you made my world so much easier! :D

In the end I combined both of the examples to one that I wanted.

I admire your forum, you are amazing people ! Thank you very much

Edited by elad1223
Link to comment
Share on other sites

  • Moderators

elad1223,

Glad we could help. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...