BarretteKinder
Member
is there somthing to copy one folder (and all other folder and file in it) in another folder?
If so, what is the value of i and of OldFolderName.
Do you have any of the variables used by the sub defined as Globals?
If you zip up the program and post it on here I will have a look at it.
If File.IsDirectory(OldRoot&"/"& OldFolderName,MyFile)=True Then
CopyDir(OldRoot & "/" & OldFolderName, NewRoot & "/" & NewFolderName, MyFile, MyFile)
FoldersCopied = FoldersCopied+1
Else
File.Copy(OldRoot&"/"&OldFolderName,MyFile, NewRoot&"/"& NewFolderName,MyFile)
FilesCopied = FilesCopied+1
End If
Hello kickaha,
The code you posted runs great as is!!
This leads to another question. Does this recursive stuff work only when a sub calls it's self or does all function/sub calls in B4A work this way? Say you have a sub that parses a string and you are calling it hundreds or times with a string variable, does it create a new set of variables each time it is called. This is of course being called from other places in the project and not from within the sub it's self.
It depends on the scope of the variables defined within the routine.
:sign0142:Just to clarify, recursion is when a sub calls itself and is very useful for tree searches and linked lists.
I was just about the ask what else recursion can be used for.
:sign0142:
I'm deducing that files n folders would be considered a tree search.
What would be a linked list?
tia
It depends on the scope of the variables defined within the routine.