Results 1 to 2 of 2

Thread: grabbing the current directory files

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    183

    Unhappy

    I've made a standard notepad that saves to a directory using a standard common dialog control, is there a way to have a textbox on the top of my notepad display all of the txt files in that directory?

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Code:
    'Use EnumDir to enumerate all files in that directory and join the array and put it int the textbox:
    Sub EnumDir(ByRef edir() As String, path As String)
    Dim n As Integer, a As String
     a = Dir(path)
     Do While Len(a)
       ReDim Preserve edir(n)
       edir(n) = a
       n = n + 1
       a = Dir
      Loop
    End Sub
    'To use
        Dim dirs() As String
        EnumDir dirs, "C:\*.txt"
        text1 = Join(dirs, " ; ")
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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