Izebize Posted July 18, 2009 Share Posted July 18, 2009 Hi! I want to create a script to download programs from the internet via the given link to it. I've created a "directory structure file" to arrange files (links) into folders, so it would be more see through. The structure looks like this (filestruct.txt): DirectoryName .SubDirName ..FileName ...-link ...-mirror ..FileName ...-link DirectoryName2 .FileName ..-link .SubDirName ..FileName ...-link I jump through the lines with FileReadLine. I use StringRegExp, to determinate the type of the current line (dir,subdir,file,link). But I have no idea how can I store it in a dinamical array. If I want to store it in an array, then I need at least a 5D array. I afraid that if I would use ReDim for every line, after some it would be slower and slower, if I add more and more files to it. Anyone knows another method for this, or to keep it fast? Maybe an already existing method to store a structure like this? And here is a simple 5D array declaration error: Dim $a1[1][1][1][1] = [[[[1]]]] ;Good Dim $a2[1][1][1][1][1] = [[[[[1]]]]] ;syntax & wrong nesting error Link to comment Share on other sites More sharing options...
BugFix Posted July 18, 2009 Share Posted July 18, 2009 Try to combine array and structure. I've not tested this, but i think i'ts possible. I know, that structure not so fast like an array. Dim $tagStructure = "wchar dir[1024];wchar sub[1024];wchar file[256];wchar link[1024];wchar mirror[1024]" Dim $aStuff[1000] For $i = 0 To UBound($aStuff) -1 $aStuff[$i] = DllStructCreate($tagStructure) Next ; set data for current value DllStructSetData($aStuff[$current], 'dir', 'the_directory') DllStructSetData($aStuff[$current], 'sub', 'the_subdirectory') DllStructSetData($aStuff[$current], 'file', 'the_file') DllStructSetData($aStuff[$current], 'link', 'the_link') DllStructSetData($aStuff[$current], 'mirror', 'the_mirror') Best Regards BugFix Link to comment Share on other sites More sharing options...
Izebize Posted July 18, 2009 Author Share Posted July 18, 2009 Sounds good, thanks! I also tryin to do it with xml, but for this I have to learn it a bit. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 18, 2009 Developers Share Posted July 18, 2009 You need a 5 d array to store this ? what is wrong with using a 2d array? Anyways how did you figure that the first line is correct because it isn't? Dim $a1[1][1][1][1] = [[[[1]]]] ;Good Dim $a2[1][1][1][1][1] = [[[[[1]]]]] ;syntax & wrong nesting error SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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