Mirage Engine
Re: Browse - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Re: Browse (/showthread.php?tid=1282)



Re: Browse - William - 15-09-2007

How do I open multiple files using the commong dialog control? I can just manage to open one at a time.
My code:
Code:
Private Sub add_Click()
    Dim sFile As String

    With dlgCommonDialog
        .DialogTitle = "Open"
        .CancelError = False
        .Filter = "mp3 Files (*.mp3)|*.mp3|"
        .ShowOpen
        If Len(.FileName) = 0 Then
            Exit Sub
        End If
        sFile = .FileName
      
        Dim i As Byte, a As Byte, b As Byte, c As Byte, FileLength As Byte
         a = 0
        For i = 1 To Len(.FileName)
            If Mid(.FileName, i, 1) = "\" Then
                a = a + 1
            Else
                b = b + 1
            End If
        Next i
        
        For i = 1 To Len(.FileName)
            If Mid(.FileName, i, 1) = "\" Then
                c = c + 1
                If c = a Then
                    FileLength = Len(.FileName) - i
                End If
            'Else
            '    b = b + 1
            End If
        Next i
        
        List2.AddItem Mid(.FileName, (Len(.FileName) - FileLength) + 1, Len(.FileName))
        'For i = (Len(.FileName) - FileLength) To Len(.FileName)

        'Next i
        List1.AddItem .FileName
    End With
End Sub



Re: Browse - Robin - 15-09-2007

:o Double post!


Re: Browse - William - 15-09-2007

Yeah sure.