Show files in C drive in textarea

BlitzPlus Forums/BlitzPlus Beginners Area/Show files in C drive in textarea

clownhunter(Posted 2005) [#1]
I'm making a program where I need to show all of the files in the C drive in a text area, and I can't think of how to do it. I have the Window, a progress bar, and the textarea set up, I just don't see how to show all of the files in the C drive in the textarea. Thanks in advance.


CS_TBL(Posted 2005) [#2]
app=CreateWindow("filez o_O",0,0,640,480)

txt=CreateTextArea(4,4,512,320,app,2)


s$=Readfiles$("c:\")

SetGadgetText txt,s$

Repeat
	WaitEvent()
	If EventID()=$803 quit=True
Until quit
End

Function Readfiles$(where$)

	myDir=ReadDir(where$) 
	
	Repeat
		file$=NextFile$(myDir) 
		If file$=""
			done=True
		Else
			If c s$=s$+Chr$(13)+Chr$(10)
			s$=s$+file$
		EndIf
		c=c+1
	Until done
	CloseDir myDir

	Return s$

End Function



clownhunter(Posted 2005) [#3]
Thanks a lot CS_TBL. I'm going to have fun with this. >:D