How to traverse folders using loops instead of recursion?

Get help with using AutoHotkey and its commands and hotkeys
afe
Posts: 616
Joined: 06 Dec 2018, 04:36

How to traverse folders using loops instead of recursion?

02 Nov 2020, 07:48

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.
Last edited by afe on 02 Nov 2020, 10:25, edited 1 time in total.
User avatar
mikeyww
Posts: 4151
Joined: 09 Sep 2014, 18:38

Re: How to traverse folders using loops instead of recursion?

02 Nov 2020, 07:51

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
afe
Posts: 616
Joined: 06 Dec 2018, 04:36

Re: How to traverse folders using loops instead of recursion?

02 Nov 2020, 08:14

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.

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKStudent, mikeyww, Spawnova, TAC109, teadrinker, Xtra, Yamiko_Hikari and 44 guests