You're trying to get the file type with a file handle. FileType accepts the path of a file, not a file handle (which you created with ReadFile).
Also, you're not closing the directory reading with CloseDir. And you don't need ReadFile unless you're going to read any data from the file (you will also need CloseFile if you do need to use ReadFile).
Try that. Not tested though.
Also, you're not closing the directory reading with CloseDir. And you don't need ReadFile unless you're going to read any data from the file (you will also need CloseFile if you do need to use ReadFile).
Function LoadApplicableData() Local Dir = ReadDir("Blitz") Local File$ Repeat File$ = NextFile(Dir) If FileType(File$)=1 Then N.Node = New Node N\Txt$ = File$ N\Dat = AddTreeViewNode(ProgNode,N\Txt$) EndIf Until File$="" End Function
Try that. Not tested though.