Post by dkl on May 15, 2021 21:28:43 GMT -5
Can't quite see what I'm doing wrong here, I've worked with Info$() before and not had this problem? I keep getting numbers for folder names.
Also how can I use 2 different fonts or colours in a text editor or listbox?
Dim info$(10,10),fold0$(300),fold1$(300)
dim info$(1, 1),FData$(300),fm$(300),Fdata1$(300),myfolder2$(300)
'nomainwin
WindowWidth = 540
WindowHeight = 500
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
listbox #main2.lb1, fold1$(),[dispFiles], 10,10,200,400
texteditor #main2.te2, 220,10,260,400
statictext #main2.st1, " - Total Folders", 55 , 418, 80, 20
textbox #main2.tb1, 10,415,40,20
statictext #main2.st2, " - Total Files", 180 , 418, 80, 20
textbox #main2.tb2, 135,415,40,20
statictext #main2.st3, "Folders", 480 , 30, 50, 20
textbox #main2.tb3, 480,50,40,20
statictext #main2.st4, "Files", 480 , 105, 50, 20
textbox #main2.tb4, 480,125,40,20
button #main2.exit, "Exit", [exIt],LR, 30, 0, 50, 20
NF = 1
fd$ = "C:\Users\kleth\Desktop\Desktop\"
fd1 = len(fd$):SL$ = "\"
Files fd$, info$()
totfd = val(info$(0,1))'0,0, = no of files to display in folder. 0,1 = no of folders(subdirectories) to display in folder **NB** includes hidden folders/files
totfl = val(info$(0,0))
print totfd'<- folders
print totfl'<- files
for nf = 1 to totfd'<- display folder/subdirectory list
fold1$(nf) = info$(nf,1)' info put into array$
fold0$(nf) = info$(nf,0)' info put into array$
print nf;" - ";info$(nf,1)
print nf;" - ";info$(nf,0)
'print nf;" - ";fold$(nf)
next nf
for nf = 1 to totfl'<- displays 'free' files list
print nf;" - ";info$(nf,0)
next nf
'put folders into listbox
open fd$ for window as #main2
#main2.tb1,totfd
#main2.tb2,totfl
wait
'display files in texteditor
[dispFiles]'choose file and get info
#main2.lb1, "selectionindex? index"
Files fd$+fold1$(index)+SL$, info$()
print fd$+fold1$(index)+SL$
nofd = val(info$(0,1))
nof = val(info$(0,0))
#main2.te2, "!cls"
'show folders
for show = 1 to nofd'<-no of folders
print show;" - ";info$(0,1)
print show;" - ";info$(show,0)
'#main2.te2, info$(show,1)
#main2.te2, "!font arial bold 14"
#main2.te2, UPPER$(info$(show,1))
next show
print nofd;" folders"
#main2.tb3, nofd
'show files
for show = 1 to nof'<-no of files
print show;" - ";info$(show,0)
print show;" - ";info$(show,0)
'#main2.te2, info$(show,0)
#main2.te2, "!font arial italic 10"
#main2.te2, lower$(info$(show,0))
next show
print nof;" files"
#main2.tb4, nof
wait
[exIt]
close #main2