Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 [ASK] Newbie del file
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ikurniawan




PostPosted: Sat May 16, 2009 11:16 am   Post subject: [ASK] Newbie del file

hi all,

Please help me, I'll try to delete some file it was succes, but if i push del twice message "Path not found" yes i know this error because the file is not found, now I want to change that message if I push twice with my own message, i'll try use Msgbox vbOKonly but not work, I want if I push twice just message "File empty" with vbokonly and go back to form
code:
Sub del()
Dim path As String
Dim x As String
path = "E:\data\*.txt"
If path <> "" Then
 x = MsgBox(" sure want delete??", vbOKCancel + vbInformation, "info1")
If x = vbOK Then
kill "E:\data\*.txt"
    MsgBox " has been located.", vbOKOnly + vbInformation, "info2"
    Else
    MsgBox " file empty.", vbOKOnly + vbInformation, "info3"
End If
End If
End Sub


please help thx
Sponsor
Sponsor
Sponsor
sponsor
ikurniawan




PostPosted: Sat May 16, 2009 1:58 pm   Post subject: Re: [ASK] Newbie del file

thx to planet source code, the problem is resolve
code:
Private Sub Command2_Click()
On Error GoTo Err_command2_Click

Kill "E:\Data\*.txt"
Err_command2_Click:
 MsgBox "file was deleted", vbOKOnly + vbCritical, "info"
 
End Sub


that's all
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: