Update 24.12.2014 (
download):
In addition to the standard file pattern,
GetFiles can now take special arguments:
1. GetFiles <pattern>
GetFiles *.asm ; simple: puts all filenames from the current folder into the Files$() array
GetFiles C:\Windows\System32\msvc*.dll|nt*.dll|nt*.exe
SortFiles ; sort the Files$() array by date, most recent files first
For_ ebx=0 To eax-1 ; print the detailed results
PrintLine Str$(GfSize(ebx)), Tb$, GfDate$(ebx), Spc2$, GfTime$(ebx), Tb$, Files$(ebx)
Next2. GetFiles CL (or GetFiles wCL for Unicode file names):
include \masm32\MasmBasic\MasmBasic.inc ; download
Init
GetFiles CL ; put filenames in the commandline into the Files$() array
For_ ebx=0 To eax-1 ; print the results
PrintLine Str$(GfSize(ebx)), Tb$, GfDate$(ebx), Spc2$, GfTime$(ebx), Tb$, "[", Left$(Files$(ebx), 90), "]"
Next
Inkey Str$("%i files found in commandline", ebx)
Exit
end start3. GetFiles WM_DROPFILES (in WndProc, main window must have WS_EX_ACCEPTFILES style):
CASE WM_DROPFILES
GetFiles WM_DROPFILES
For_ ebx=0 To eax-1 ; show the files in the edit control
AddWin$ hEdit=Str$(GfSize(ebx))+Tb$+GfDate$(ebx)+Spc2$+GfTime$(ebx)+Tb$+Files$(ebx)+CrLf$
Next
#2 is handy when the user drags a group of files from Explorer over the name of the executable (i.e. the files are passed via the commandline).
#3 does the same but with files dropped over the window itself. During installation, you will see the MasmBasic guide; on top of the page, click on "File" to the left of
the usual disclaimers apply, and choose "New Masm source". In the green window, click on
Simple window in the upper left corner, hit F6 to build the application, then select files in Explorer and drag them over the application.