Why does this produce an error?
BlitzMax Forums/BlitzMax Programming/Why does this produce an error?
| ||
From the BlitzMax docs, with SuperStrict added:SuperStrict Local dir:String = ReadDir(CurrentDir()) If Not dir RuntimeError "failed to read current directory" Repeat Local t:String = NextFile( dir ) If t="" Exit If t="." Or t=".." Continue Print t Forever CloseDir dir |
| ||
local dir:string should be local dir:int as ReadDir returns an integerSuperStrict Local dir:Int = ReadDir(CurrentDir$()) If Not dir RuntimeError "failed to read current directory" Repeat Local t:String= NextFile$( dir ) If t="" Exit If t="." Or t=".." Continue Print t Forever CloseDir(dir) |
| ||
Got it. Thanx tonyg. |