Your Products have been synced, click here to refresh
[COLOR="YellowGreen"]' Simple filearray ' ' vpt.se 2010[/COLOR] Sub Main() Dim FileArray() As String Dim FileName As String [COLOR="YellowGreen"]' Setup Folder And filecounter ' Example lists all bitmaps In C:\Windows[/COLOR] Folder = Dir("C:\Windows\*.bmp") count = 0 [COLOR="yellowgreen"]' Parse the folder Until filename returns empty (no more files) ' And count the files ending With .bmp[/COLOR] While Folder <> "" count = count + 1 Folder = Dir Wend [COLOR="yellowgreen"]' The MsgBox is For debug/example purposes And displays the ' number of bitmaps found[/COLOR] MsgBox "Filecount: " & count [COLOR="yellowgreen"]' Initialize the FileArray (create the array) With the size of ' count (number of files found)[/COLOR] ReDim FileArray(count) [COLOR="yellowgreen"]' Fill the filearray With the bitmap filenames[/COLOR] FileArray(0) = Dir("C:\Windows\*.bmp") [COLOR="yellowgreen"]' For debug/example purposes, displays the bitmap filenames[/COLOR] For i = 1 To count FileArray(i) = Dir FileName = FileName + Chr(13) + FileArray(i) Next i MsgBox FileName End Sub
[COLOR="YellowGreen"]' Simple filearray ' ' vpt.se 2010[/COLOR] Sub Main() Dim FileArray() As String Dim FileName As String [COLOR="YellowGreen"]' Setup Folder And filecounter ' Example lists all bitmaps In C:\Windows[/COLOR] Folder = Dir("C:\Windows\*.bmp") count = 0 [COLOR="yellowgreen"]' Parse the folder Until filename returns empty (no more files) ' And count the files ending With .bmp[/COLOR] While Folder <> "" count = count + 1 Folder = Dir Wend [COLOR="yellowgreen"]' The MsgBox is For debug/example purposes And displays the ' number of bitmaps found[/COLOR] MsgBox "Filecount: " & count [COLOR="yellowgreen"]' Initialize the FileArray (create the array) With the size of ' count (number of files found)[/COLOR] ReDim FileArray(count) [COLOR="yellowgreen"]' Fill the filearray With the bitmap filenames[/COLOR] FileArray(0) = Dir("C:\Windows\*.bmp") [COLOR="yellowgreen"]' For debug/example purposes, displays the bitmap filenames[/COLOR] For i = 1 To count FileArray(i) = Dir FileName = FileName + Chr(13) + FileArray(i) Next i MsgBox FileName End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |