Berti Posted October 8, 2005 Share Posted October 8, 2005 Hi, I want to create folders in a loop The following loop ist working: $dir[1]= "FolderA" $dir[2]= "FolderB" $dir[3]= "FolderC" For $i=1 to 3 DirCreate($dir[$i]) ... ... Next But if I try to create the new folders in a subfolder it doesn't work! For $i=1 to 3 DirCreate("\folder1\folder2\$dir[$i]") ... ... Next Whats going wrong? Berti Link to comment Share on other sites More sharing options...
peethebee Posted October 8, 2005 Share Posted October 8, 2005 Hi!Try this:For $i=1 to 3 DirCreate("\folder1\folder2\" & $dir[$i]) ... ... NextExplanation:In your case the array expression is not interpreted as it is in a string (determinated by the "). Now it is outside the string, is interpreted and the result is cancated with the first part of the dir to create (using &).peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Link to comment Share on other sites More sharing options...
Berti Posted October 8, 2005 Author Share Posted October 8, 2005 Thank you, my mistake. Sometimes it's so easy Berti Link to comment Share on other sites More sharing options...
peethebee Posted October 8, 2005 Share Posted October 8, 2005 Hi! Of cours, no hard one. If you insert a MsgBox with the parameter of the dricreate func you see that it has not been interpreted. peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 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