|
-
Jul 5th, 2000, 11:15 AM
#1
Thread Starter
Frenzied Member
I have a program that copies certain files to a floppy disk, and if someone clicks the "create floppy" button, and there is a floppy disk in it, it writes to the dsik.
but if there is no floppy disk in there then a runtime error comes up and it closes the program, is there something that I can do to make an error message come up saying that there is no floppy, instead of having the program crash?
NXSupport - Your one-stop source for computer help
-
Jul 5th, 2000, 11:24 AM
#2
Addicted Member
Error trapping!!!!!!
You're looking for error 68 or 76 - I forget which...
Visual Basic 6 Enterprise Edition + SP4
-
Jul 5th, 2000, 11:25 AM
#3
_______
<?>
ok..do it and get the error number
then in your createfloppy routine do this
'in the click event of the create
On Error Goto NoDisk:
do your stuff
bla bla
NoDisk:
if err.number = "your error number" then
msgbox "Sorry, you need a disk"
exit sub
endif
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jul 5th, 2000, 11:30 AM
#4
_______
or
you could just check the dir and that will generate
err.number 52
like this.
Private Sub Command1_Click()
On Error GoTo NoDisk:
Dir "a:\"
MsgBox "I didn't work."
NoDisk:
If Err.Number = "52" Then
MsgBox "Tell them whatever"
Exit Sub
End If
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jul 5th, 2000, 11:32 AM
#5
Thread Starter
Frenzied Member
Re: <?>
the error number is 71, thanx, it worked
NXSupport - Your one-stop source for computer help
-
Jul 5th, 2000, 12:21 PM
#6
Just a note. Since Number is the default property for Err, you can omit it and you can omit the quotes around the numbers as well.
-
Jul 5th, 2000, 12:24 PM
#7
Thread Starter
Frenzied Member
NXSupport - Your one-stop source for computer help
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
|