Results 1 to 2 of 2

Thread: get filenames in a directory

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    Exclamation

    Hi,

    I have a problem ...

    In a directory (c:\test) are some files.
    there are 5 *.bmp's and 2 *.exe's and 3 *.zip's.

    I wand to capture in a array the names of the *.bmp's.

    thanks

    R@emdonck

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'access all bmp files within a folder
    
    Private Sub Command1_Click()
        Dim stFile As String
        Dim stDir As String
        Dim myArr()
        Dim i As Integer
        
        stDir = "C:\Test\"
        stFile = Dir$(stDir & "*.bmp")
        
        Do While stFile <> ""
           ReDim Preserve myArr(i)
    'if you want the path as well it would be
    'myarr(i) = stdir & stfile    
          myArr(i) = stFile
          i = i + 1
          stFile = Dir
        Loop
    
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width