|
-
Jun 2nd, 2000, 09:12 PM
#1
Thread Starter
Hyperactive Member
Private Sub Command1_Click()
MsgBox "Are you sure you wish to delete the files?"
Kill "C:\windows\desktop\test\*.*"
End Sub
ok... I had the exact same problem in QBasic... it wouldn't delete all the files in the directory...it says "File not found" Can I not use this command with multiple files?
-
Jun 2nd, 2000, 09:28 PM
#2
transcendental analytic
No you have to retrieve all the files with Dir and then delete each file
Code:
Dim a$
a=dir(path)
do while len(a)
kill path & "\" & a
a=dir
loop
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.
-
Jun 2nd, 2000, 09:53 PM
#3
You also want to make sure you process the answer to your "Are you sure you wish to delete..." question.
Private Sub Command1_Click()
Dim intResponse as Integer
intResponse = MsgBox("Are you sure you wish to delete the files?", vbYesNo)
If inResponse = vbYes then
' kill the files
End If
End Sub
-
Jun 2nd, 2000, 11:52 PM
#4
transcendental analytic
Of course! I forgot that Martin.
if MsgBox("Are you sure you wish to delete the files?", vbYesNo) = vbYes then
if MsgBox("Are you really sure?", vbYesNo) = vbYes then
if MsgBox("Hey! Those file are very important, do you actually want to delete them?", vbYesNo) = vbYes then
if MsgBox("Don't press yes, will you?", vbYesNo) = vbYes then
if MsgBox("Press no, or i'll kill you too", vbYesNo) = vbYes then
'Kill the files
end if
end if
end if
end if
end if
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.
-
Jun 3rd, 2000, 01:38 AM
#5
I find the DIR() very messy, I use the FileSystemObject, which lets you use For...Each...Next to manipulate files in a folder.
-
Jun 3rd, 2000, 01:53 AM
#6
The advantage of using Dir function is that you don't have to ditribute extra DLL for filesystem object.
-
Jun 3rd, 2000, 02:41 AM
#7
transcendental analytic
Yup, all the function in filesystemobject can you do with vb, and they will run faster that way. There's probably only one thing you can't do with files, and that's cropping them while open in binary
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|