|
Post by honky on May 8, 2021 16:57:14 GMT
Hello good afternoon, a$ is good, why nfi is no good ?
' NOMAINWIN mapw=500: maph= 500 WindowWidth=mapw+15: WindowHeight=maph+40 UpperLeftX = 10: UpperLeftY = 20 TEXTBOX #w.box, 20 , 10, 180, 25 BUTTON #w.go, "Go !", [go], UL, 250, 10, 40, 20 TEXTEDITOR #w.te, 10, 50, 250, 430 GRAPHICBOX #w.g, 5, 5, mapw, maph OPEN "Help" FOR window_nf AS #w #w, "TRAPCLOSE [closeHelp]" ' #w.m, "when leftButtonDown [scanne]" #w.g, "down;fill darkpink;color white;backcolor darkpink" dim info$(10, 10): dim array$(10, 10) wait [go] ' filedialog "Open text file", "*", fileName$ print fileName$ files "F:\", "*.", info$() nbim$=info$(0,1): nbim=val(nbim$)
for xa=1 to nbim a$=info$(xa, 1) print a$'*************** '***************************** files "F:\";a$,"*.", array$() nfi$=array$(0,0): nfi=val(nfi$) print nfi'************* for xx=1 to nfi ab$=info$(xx, 0) print " ";ab$'***************** next xx next xa wait [closeHelp] CLOSE #w END
|
|
|
Post by tsh73 on May 8, 2021 18:47:42 GMT
While it looks that for getting folders file mask is not used so
files "F:\", "*.", info$() works OK
it definitely works for getting files. So
files "F:\", "*.", info$() only shows files without extension - rare beasts I must say.
files "F:\", "*.*", info$() will list all files.
EDIT
also while looping for NFI, you should use array$(xx, 0), not info$(xx, 0)
for xx=1 to nfi ab$=info$(xx, 0)
|
|
|
Post by Rod on May 8, 2021 18:51:04 GMT
You also use array$() instead of info$()
|
|
|
Post by honky on May 8, 2021 20:30:31 GMT
"files "F:\", "*.", info$()" Show the folders a$ ares folders array$-->info$ it's simply copy error But so whith array$, nfi=0 nfi should be show files number of any folders. Why no ? And even putting ".bas" or ".bmp" extensions it's work
|
|
|
Post by tsh73 on May 8, 2021 20:56:05 GMT
Do you know what file name wildcard is? *. and *.* match *different* set of file names. If you want all the files, use "*.*"
go and experiment, run windows CMD and type DIR *. DIR *.*
|
|
|
Post by honky on May 8, 2021 20:59:15 GMT
"files "F:\", "*.", info$()" Show the folders a$ ares folders array$-->info$ it's simply copy error But so whith array$, nfi=0 nfi should be show files number of any folders. Why no ? And even putting ".bas" or ".bmp" extensions it's work Whith this is good [go] ' filedialog "Open text file", "*", fileName$ 'print fileName$ files "F:\", "*.", info$() nbim$=info$(0,1): nbim=val(nbim$) for xa=1 to nbim a$=info$(xa, 1) print a$'*************** '***************************** files "F:\";a$,"*.bmp", array$() files "F:\";a$,"*.bas", brut$() nfi$=array$(0,0): nfi=val(nfi$) anfi$=brut$(0,0): anfi=val(anfi$) print nfi'************* for xx=1 to nfi ab$=array$(xx, 0) print " ";ab$'***************** next xx for xb=1 to anfi ac$=brut$(xb,0) print " ";ac$'***************** next xb next xa wait
|
|
|
Post by honky on May 8, 2021 21:03:43 GMT
Do you know what file name wildcard is? *. and *.* match *different* set of file names. If you want all the files, use "*.*" go and experiment, run windows CMD and type DIR *. DIR *.* VĂ©ry thank you tsh73 !!! *.* is more excellent
|
|