NextFile?

BlitzPlus Forums/BlitzPlus Programming/NextFile?

neos300(Posted 2009) [#1]
dir = ReadDir("C:")
file$ = NextFile$(dir)
If file$ = "" Then Exit
If FileType(params$ + "\" + file$) = 2 Then
echo("\" + file$)
Else
echo(file)
EndIf

For some reason on file$ = NextFile$(dir) i get a variable type mismatch.


okee(Posted 2009) [#2]
It's been a while since i used Blitz+ but
Exit only works in a For loop
There's no echo command in Blitzplus

dir = ReadDir("C:")
file$ = NextFile$(dir)
If file$ <> "" Then 
	If FileType(params$ + "\" + file$) = 2 Then
		Print("\" + file$)
	Else
		Print(file)
	EndIf
EndIf
WaitKey



neos300(Posted 2009) [#3]
Ok, but that still dosent solve the problem of the file$ var type mismatch.


Flexman(Posted 2009) [#4]
Yes, I get this problem too. Type mismatch.

Bug?


blackgecko(Posted 2009) [#5]
I don't have problems with the second code. It says
\$Recycle.Bin

so it works. Perhaps you used the variable "file" somewhere before as an Integer.
btw, in line 7 you should write
Print(file$)

Thats proper.