|
-
Mar 6th, 2002, 11:11 PM
#1
Thread Starter
Hyperactive Member
File already exist...
I have a sub that saves all the information I have in a file. Now I would like my sub to do just like almost all the "save" function do which is to check if the name already exist and see if the person want to replace it.... How do I do this??
Here's a part of the code I already have:
VB Code:
Dim intFileNo As Integer
With dlg
.Filter = "Protoypes (.c .cpp)|*.c;*.cpp|"
.FilterIndex = 1
.DefaultExt = "c"
.FileName = nomFich
.ShowSave
End With
intFileNo = FreeFile
Open dlg.FileName For Binary As intFileNo
Put intFileNo, , str
Close intFileNo
Thanx in advance
-
Mar 6th, 2002, 11:19 PM
#2
VB Code:
Dim intFileNo As Integer
With dlg
.Flags = cdlOFNOverwritePrompt ' <--------------
.Filter = "Protoypes (.c .cpp)|*.c;*.cpp|"
.FilterIndex = 1
.DefaultExt = "c"
.FileName = nomFich
.ShowSave
End With
intFileNo = FreeFile
Open dlg.FileName For Binary As intFileNo
Put intFileNo, , str
Close intFileNo
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Mar 6th, 2002, 11:23 PM
#3
Thread Starter
Hyperactive Member
Thank you!! but now, how do I know if the person said yes or no whether or not he wanted to replace it??
-
Mar 6th, 2002, 11:24 PM
#4
If you click 'No', it should keep the dialog open until you pick another file, or hit cancel.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Mar 6th, 2002, 11:33 PM
#5
Thread Starter
Hyperactive Member
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
|