Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Christian Tabligan
  Where is Christian Tabligan?
 Bacolod City, Neg. Occ.
 Philippines
 Christian Tabligan
 To: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 Tags
Subject: RE: how to save file to particular location
Thread ID: 268880 Message ID: 268903 # Views: 26 # Ratings: 0
Version: Visual FoxPro 6 Category: VFP and .NET
Date: Thursday, July 15, 2010 10:30:49 AM         
   


> >
> > try this..
> >
> >
> > PUBLIC oform1
> > 
> > oform1=NEWOBJECT("form1")
> > oform1.Show
> > RETURN
> > 
> > **************************************************
> > *-- Form:         form1 (c:\frmmain.scx)
> > *-- ParentClass:  form
> > *-- BaseClass:    form
> > *
> > DEFINE CLASS form1 AS form
> > 
> > 
> > 	Top = 16
> > 	Left = 44
> > 	Height = 116
> > 	Width = 235
> > 	DoCreate = .T.
> > 	Caption = "Form1"
> > 	Name = "Form1"
> > 
> > 
> > 	ADD OBJECT command2 AS commandbutton WITH ;
> > 		Top = 60, ;
> > 		Left = 84, ;
> > 		Height = 27, ;
> > 		Width = 84, ;
> > 		Cancel = .T., ;
> > 		Caption = "Save", ;
> > 		Name = "Command2"
> > 
> > 
> > 	ADD OBJECT txtfilename AS textbox WITH ;
> > 		Value = "C:\MyFolder\MyFile", ;
> > 		Height = 23, ;
> > 		Left = 24, ;
> > 		Top = 24, ;
> > 		Width = 192, ;
> > 		Name = "txtFileName"
> > 
> > 
> > 	PROCEDURE command2.Click
> > 		set safety off
> > 		create table temp (letter c(1))
> > 		insert into temp values ("A")
> > 		insert into temp values ("B")
> > 		insert into temp values ("C")
> > 		insert into temp values ("D")
> > 		insert into temp values ("E")
> > 		insert into temp values ("F")
> > 
> > 		cFileLocation = ALLTR(thisform.txtFilename.value)
> > 		IF !DIRECTORY(JUSTPATH(cFileLocation))
> > 		   MD JUSTPATH(cFileLocation)
> > 		ENDIF
> > 		copy to (cFileLocation) type xls
> > 	ENDPROC
> > 
> > 
> > ENDDEFINE
> > *
> > *-- EndDefine: form1
> > **************************************************
> > 

> >
> > Best Regards,
> >
> > CriZ (,")
> >
> > "Happiness is real when shared."
>
>
> Hello Chriz,
>
> Just one suggestion with this:
>
>
IF !DIRECTORY(JUSTPATH(cFileLocation))
> 

>
> Better:
>
>
IF !DIRECTORY(JUSTPATH(cFileLocation),1)
> 

>
> ;-)

It's been 3 years haven't use VFP. I almost forgot those simple functions. ;-)

Thanks Jun! ;-)

Best Regards,

CriZ (,")

"Happiness is real when shared."

ENTIRE THREAD

how to save file to particular location Posted by loo peng @ 7/15/2010 7:58:06 AM
RE: how to save file to particular location Posted by Christian Tabligan @ 7/15/2010 8:20:05 AM
RE: how to save file to particular location Posted by Jun Tangunan @ 7/15/2010 10:10:18 AM
RE: how to save file to particular location Posted by Christian Tabligan @ 7/15/2010 10:30:49 AM
RE: how to save file to particular location Posted by Glen Villar @ 7/15/2010 10:36:32 AM
RE: how to save file to particular location Posted by Christian Tabligan @ 7/15/2010 10:53:47 AM
RE: how to save file to particular location Posted by loo peng @ 7/15/2010 10:48:26 AM
RE: how to save file to particular location Posted by Christian Tabligan @ 7/15/2010 10:54:31 AM
RE: how to save file to particular location Posted by Tom Saddul @ 7/15/2010 8:28:22 AM
RE: how to save file to particular location Posted by Samir H. @ 7/15/2010 9:12:33 AM
RE: how to save file to particular location Posted by loo peng @ 7/15/2010 10:47:29 AM
RE: how to save file to particular location Posted by Tamar Granor @ 7/15/2010 10:54:50 PM