The multiple file select "Open file dialog" works great now! (Thanks!)
BUt now i have another issue.
I'm putting all of the files into a ListView and that works great but I want to determine if a file has already been added.
That piece of the code broke when I made it open multiple files:
It basically states that if you only open one file, it now determines that file is added whether it is or is not.
And multiple files? It doesn't even check, or does not return anythign if the multiple file is there.
Would there be a better way to do an Array Scan with the Listview? Since it is disaplying the actual files that were opened?
------------------
Scott
mailto:[email protected][email protected]</A>
BUt now i have another issue.
I'm putting all of the files into a ListView and that works great but I want to determine if a file has already been added.
That piece of the code broke when I made it open multiple files:
It basically states that if you only open one file, it now determines that file is added whether it is or is not.
And multiple files? It doesn't even check, or does not return anythign if the multiple file is there.
Would there be a better way to do an Array Scan with the Listview? Since it is disaplying the actual files that were opened?
Code:
g_Result = MyOpenFileDialog(ByVal hDLg,_ ByVal Caption,_ FileSpec,_ g_CurrWorkingDir,_ ByVal Filter,_ ByVal DefExtension,_ lStyle) lResult = Tally(FileSpec,Chr$(0)) If lResult <> 0 Then 'Parse out the multiple files CurrentDir = Parse$(FileSpec,Chr$(0),1) FileSpec = Right$(FileSpec,Len(FileSpec) - Instr(FileSpec,Chr$(0))) 'REMOVE the directory If IsFalse g_FileIndex Then g_FileIndex = 1 'Prevent GPF if at zero For lLoop = g_FileIndex To lResult g_Files(lLoop) = CurrentDir & "\" & Parse$(FileSpec,Chr$(0),lLoop) ListBox Add hDlg, %IDLISTBOX1, g_Files(lLoop) g_FileIndex = lLoop 'Keep index up to date Next Else 'Add the single file but First make sure it's not in the list already Incr g_FileIndex g_Files(g_FileIndex) = FileSpec ListBox Add hDlg, %IDLISTBOX1, g_Files(g_FileIndex) End If Array Scan g_Files(), Collate Ucase, = FileSpec, To DuplicateCheck If DuplicateCheck Then MsgBox "The file " & g_Files(DuplicateCheck) & " is already added", %MB_ICONINFORMATION,g_szCCS Exit Function End If
Scott
mailto:[email protected][email protected]</A>
Comment