@bplus;
@Petr:
Repeat after me: "I'm a big dummy. I'm a big dummy. I'm a big dummy." Repeat for the next several minutes, then read WHY we're all such failures with such simple code -- yours truly included....
C strings are NOT the same as QB64 strings!!!Everyone knows this, and yet, we all let it bite us in the ass, in this case!
Let's take for example a simple call to our function like so:
cd$ = _CWD$ 'testing in QB64 folder
MakeTree cd$
This fails to perform as expected. (In some ways, I'm surprised to find that it performs at all!)
WHY??
Because _CWD$ returns a QB64 formatted string, and *NOT* a string as we'd normally expect to find in C.
It's *not* null terminated!!Maketree cd$ + CHR$(0) is probably what we need to get it to work, in all honesty! At least, playing around with my own little recursive routine, it's what was needed to (mostly) fix things. My problem now is that I'm capturing too many recursions, and rechecking everything over and over endlessly... The exit to my loop is broken somewhere. :P
Anyway, I'd think if you want to sort out the bugs in your routines, you might want to null terminate your strings, and then a lot of the issues might end up going away for you guys. It's worth a shot anyways. I'm going to keep playing around with my own little thing, and I'll keep you updated with what I come up with as I progress. ;)