How to traverse folders using loops instead of recursion? Do I need to prepare an array and save the folders in the current directory to the array. When the current directory is traversed, take out a value from the array and traverse again until the array is empty?
The actual problem is more complicated, the situation is like this:
For example, the web response is a JSON containing several arrays. When a certain value of the array is a folder, this folder needs to be recursed. Moreover, the trouble is that when the number of arrays exceeds a threshold, the folder needs to be recursively continued, like paging.
How to traverse folders using loops instead of recursion?
How to traverse folders using loops instead of recursion?
Last edited by afe on 02 Nov 2020, 10:25, edited 1 time in total.
Re: How to traverse folders using loops instead of recursion?
There are bunches of posts about this. Would try a search-- may save you time.
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=82399
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=82399
Re: How to traverse folders using loops instead of recursion?
However, this is not the same problem. To be more specific, the traversal of folders I mentioned may not really mean traversing the local computer folders. This is just an analogy.
Re: How to traverse folders using loops instead of recursion?
If it's an analogy I don't understand the question. Loop can be done in these two ways:
https://www.autohotkey.com/docs/commands/Loop.htm
https://www.autohotkey.com/docs/commands/For.htm
https://www.autohotkey.com/docs/commands/Loop.htm
https://www.autohotkey.com/docs/commands/For.htm
Re: How to traverse folders using loops instead of recursion?
better post code, not analogies
Who is online
Users browsing this forum: AHKStudent, mikeyww, Spawnova, TAC109, teadrinker, Xtra, Yamiko_Hikari and 44 guests