BCX Console Demonstration Program s149.bas

 ' -------------------------------------------------------------------- 
 ' Shows how to multi-select files using Windows common dialog 
 ' Thanks to Larry Keys for enhancing GETFILENAME$ to support this 
 ' -------------------------------------------------------------------- 
 
 DIM A$ * 500000
 
 DIM FileName$[10000]
 DIM i, o
 
 A$ = GETFILENAME$ _
 ("OPEN", "Bas Files(*.bas)|*.bas;", 0, NULL, OFN_EXPLORER|OFN_ALLOWMULTISELECT)
 
 IF INCHR(A$, ",") > 0 THEN
   o = SPLIT(FileName$, A$, ",") 'multiple files separated by commas! 
   FOR i = 1 TO o - 1
     PRINT i; ") "; FileName$[i]
   NEXT
 ELSE
   PRINT A$
 END IF