Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Clipper Visual-Objects > Re: Save Dialog...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 11302 of 11795
Post > Topic >>

Re: Save Dialogue

by "Paul D B" <polleke@[EMAIL PROTECTED] > Apr 10, 2008 at 05:06 PM

brian@[EMAIL PROTECTED]
 wrote:
> Hi,
>
> I have code to save file (see below) but I dont know how to check if a
> file with the same name already exists in that folder to warn user.
>
> Any help please.
>
>
> oSaveAsDialog:=SaveAsDialog{ , CSVName()}
> oSaveAsDialog:Caption:="Save As"
> oSaveAsDialog:SetStyle(OFN_ALLOWMULTISELECT,FALSE)
> oSaveAsDialog:InitialDirectory := aPath[1]
> oSaveAsDialog:SetFilter({"*.CSV"},{"CSV Only"})
> action:= oSaveAsDialog:Show()
>
> uFileName := oSaveAsDialog:FileName
> nPos := RAt('.',uFileName)
>
> IF uFileName != NULL_STRING
>
>   cExt := Left(uFileName,nPos) //Get file name and path left of
> extension
>   oSelf:cFileName := cExt+'CSV' //Force CSV on extension if user
> enters something else
>
> lFileSelected := TRUE
> ELSE
>  lFileSelected := FALSE
> ENDIF
>
> RETURN lFileSelected

Brian,
Windows will do this for you if you set the appropriate flag

oSAD:= SaveAsDialog{SELF,"ExpSBGoogle.TXT" }

oSAD:SetStyle(OFN_NOCHANGEDIR,TRUE)

oSAD:SetStyle(OFN_PATHMUSTEXIST, TRUE)

oSAD:SetStyle(OFN_HIDEREADONLY, TRUE)

oSAD:SetStyle(OFN_OVERWRITEPROMPT,TRUE) // THIS IS THE ONE !!


HTH
-- 
Paul
 




 5 Posts in Topic:
Save Dialogue
"brian@[EMAIL PROTEC  2008-04-10 05:05:57 
Re: Save Dialogue
Karl Faller <k.faller_  2008-04-10 15:19:42 
Re: Save Dialogue
kdmurphy@[EMAIL PROTECTED  2008-04-10 07:57:03 
Re: Save Dialogue
"Paul D B" <  2008-04-10 17:06:02 
Re: Save Dialogue
"brian@[EMAIL PROTEC  2008-04-11 01:55:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 17:59:21 CST 2008.