Results 1 to 7 of 7

Thread: Error #5?????

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85

    Question

    Public Function FileFinder(WatchingDir As String)
    Dim filename As String
    FileFinder = Dir(WatchingDir)
    Do Until FileFinder = ""
    filename = FileFinder
    If filename <> "" Then
    Text1.Text = "Processing " & filename
    MoveDir (filename)
    End If
    FileFinder = Dir
    Loop

    End Function

    When I run the above code I get this error:

    Run-Time error '5'
    Invalid procededure call or argument

    on this line

    FileFinder = Dir

    Any suggestions??

    Using VB6 Still Pluging away

  2. #2
    Lively Member
    Join Date
    Jul 2000
    Posts
    94
    try this:
    filefinder = Dir()

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85

    Angry

    Did not work, still the same error. Thanks for the help though.
    Using VB6 Still Pluging away

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    You will get that error whenever you didn't specify which directory you search first.
    Code:
    FIleFinder=Dir(YourPath)
    Then you can use Dir to find the next files or directories
    Code:
    FileFinder=Dir
    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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85
    I have that, but it won't loop through the directory with the MoveDir(filename) code in it. It gets stuck on the first file and won't do or move anywhere else. With the MoveDir(filename) not there it loops through the directory just fine.
    Using VB6 Still Pluging away

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    How am i suppose to know what you have in MoveDir()?
    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.

  7. #7
    Hyperactive Member MPrestonf12's Avatar
    Join Date
    Jun 1999
    Location
    NY
    Posts
    330

    Cool try this

    Try a on error resume next
    Matt

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