Why does this produce an error?

BlitzMax Forums/BlitzMax Programming/Why does this produce an error?

Tachyon(Posted 2005) [#1]
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



tonyg(Posted 2005) [#2]
local dir:string should be local dir:int as ReadDir returns an integer
SuperStrict

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)




Tachyon(Posted 2005) [#3]
Got it. Thanx tonyg.