LoadDir() won't return anything

BlitzMax Forums/BlitzMax Beginners Area/LoadDir() won't return anything

Mr. Goober(Posted 2014) [#1]
Every now and again I'll get this weird bug where LoadDir() won't return anything, even if I give it an argument like CurrentDir(), and I know there's files in there. Is this a common bug?

Global _d :String[] = LoadDir(CurrentDir())
Print Len(_d)	' prints 0
Input
End



Who was John Galt?(Posted 2014) [#2]
Does Len even work with arrays?

Try

for s:string=eachin _d
print s
next


Mr. Goober(Posted 2014) [#3]
I does work with arrays. array.length also works.

I reinstalled BlitzMax (v1.50) and it seemed to have fixed the problem. I think what I may have done was hit some weird keyboard combination and caused it to make file reading not work or something.

Similarly, if you hold Ctrl + Shift + ", it turns the quotes you type all formal and stuff. It was weird when I discovered that at first. Use the same key combination to turn it back.

SuperStrict

Global _s :String[] = LoadDir(CurrentDir())
Print _s.length

For Local i :String = EachIn _s
	Print i
Next


Output:
5
.bmx
TEST.bmx
TEST.bmx.bak
TEST.debug.mt.exe
TEST.mt.exe


It works now after the reinstall. I'll have to figure out what I hit by accident and why it does that.