[bb] Recirsive ScanDir() func by bytecode77 [ 1+ years ago ]

Started by BlitzBot, June 29, 2017, 00:28:39

Previous topic - Next topic

BlitzBot

Title : Recirsive ScanDir() func
Author : bytecode77
Posted : 1+ years ago

Description : this is a lil scandir function(if someone needs...)
i have made it within 5 minutes :) but it meight be helpful for noobs...


Code :
Code (blitzbasic) Select
Graphics 1280, 1024, 32, 1
SetBuffer BackBuffer()
AppTitle "ScanDir"

ScanDir("c:Windows")
WaitKey()
End

Function ScanDir(path$)
dir = ReadDir(path$)
Repeat
file$ = NextFile(dir)
If file$ = "" Then Exit
If file$ <> "." And file$ <> ".." Then
Select FileType(path$ + file$)
Case 1
Color 0, 255, 0
Print "File: " + path$ + file$
Case 2
Color 255, 0, 0
Print "Dir: " + path$ + file$ + ""
ScanDir(path$ + file$ + "")
End Select
EndIf
Forever
CloseDir dir
End Function


Comments :


Nicstt(Posted 1+ years ago)

 thanks saves me writing it, next task was to code this