Results 1 to 3 of 3

Thread: Help with the Kill command:

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    84

    I put a few lines of code in the app I'm working on to kill some files:

    File = Dir$(MyDir)
    Do While File <> ""
    MyStr = Left(File, 4)
    If MyStr = "test" Then
    MyTemp = MyDir + File
    kill MyTemp
    End If
    File = Dir$
    Loop

    Right after I typed that in it worked. But now I always get a "Compile Error: Invalid use of Property", and VB takes the K down to lowercase.... without blue coloring as if not recognizing it as a command.

    I really can't figure out what the problem is... it did work the first time!

    Thanks for any help


  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    That could occur because of a property named kill.
    Code:
    Option Explicit
    
    Property Get kill()
        
    End Property
    
    Property Let kill(V)
        
    End Property
    
    Sub Test()
        kill "MyFile" ' Compile error: Invalid use of property
    End Sub
    If that is the case, rename the property.
    This is also why Kill refuses to be proper-cased.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    84
    Man I'm stupid... that was exactly it. I named the button for the function "kill".

    ....live and learn.

    Thank you very much!

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