Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


GetFile to save to other DIR


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-04-2008, 04:12 PM
Junior Member
 
Join Date: May 2007
Posts: 29
Default GetFile to save to other DIR

Hi all,

Can anyone help me to write a code to select a file in the Dir(eg. textall.dat) and safe it to another Dir?

I tried SaveDialog but the filename field is emty. I wanted filename field to be fill up w/o letting the user select.

Thanks
TC
Reply With Quote
  #2 (permalink)  
Old 08-04-2008, 06:55 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,186
Default

Can you give an example of what you are trying to achieve?
Reply With Quote
  #3 (permalink)  
Old 08-04-2008, 07:11 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 649
Default

Quote:
Originally Posted by tcgoh View Post
I tried SaveDialog but the filename field is emty. I wanted filename field to be fill up w/o letting the user select.
To preselect a filename in the savedialog you have to define the file property of the savedialog before showing it, e.g.:
Code:
	SaveDialog1.File = AppPath & "\test.txt"
	SaveDialog1.Show
specci48


Edit: added a very simple copy sample...
Attached Files
File Type: sbp CopyFile.sbp (709 Bytes, 4 views)

Last edited by specci48 : 08-04-2008 at 07:19 PM.
Reply With Quote
  #4 (permalink)  
Old 08-05-2008, 03:34 AM
Junior Member
 
Join Date: May 2007
Posts: 29
Default

[quote=specci48;15555]To preselect a filename in the savedialog you have to define the file property of the savedialog before showing it, e.g.:
Code:
	SaveDialog1.File = AppPath & "\test.txt"
	SaveDialog1.Show
Hi specci48 and Erel

Thanks for the code and help. The Savedialog1.file=AppPath &"\test.txt" helps, but the "text.txt" file in the "file name: box"(see attached jpg) is NOT SAVING to any directory? I don't understand why?

save dir.jpg

Thanks
Reply With Quote
  #5 (permalink)  
Old 08-05-2008, 07:51 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Why not read the file to end and write the file again in the new dir, this way the user is not prompt in any way...
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #6 (permalink)  
Old 08-05-2008, 05:57 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 649
Default

Quote:
Originally Posted by Cableguy View Post
Why not read the file to end and write the file again in the new dir...
Just use filecopy
Reply With Quote
  #7 (permalink)  
Old 08-06-2008, 04:21 AM
Junior Member
 
Join Date: May 2007
Posts: 29
Default

Quote:
Originally Posted by specci48 View Post
Just use filecopy
Actually its a SQL file(sl3). Its about 2mb, haven't try yet, not sure it will work? will it?

Thanks
Reply With Quote
  #8 (permalink)  
Old 08-08-2008, 02:53 AM
Junior Member
 
Join Date: May 2007
Posts: 29
Default

Hi All,

Thanks for all that help here. I Have manage to pre-select the file to safe into another directory. (its a NO GO to read sl3 file and filewrite again)

However, appreciate if anyone can help to shortern the steps required to safe the selected file without having to show the openDialog.

Thanks.
Reply With Quote
  #9 (permalink)  
Old 08-08-2008, 01:13 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Posting the Actual code would help us Help you...How can we shorten the steps if we do not know the way you took?
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing

Last edited by Cableguy : 08-08-2008 at 01:15 PM.
Reply With Quote
  #10 (permalink)  
Old 08-09-2008, 06:17 AM
Junior Member
 
Join Date: May 2007
Posts: 29
Default

Thanks Cableguy, problem solved. Here the code

opendialog1.File = AppPath & "\alldata.sl3"
openDialog1.Filter = "sl3 DATA Files|*.sl3"

SaveDialog1.File = OpenDialog1.File

If SaveDialog1.Show = cCancel Then
Return
End If


FileCopy(OpenDialog1.File, SaveDialog1.File)

Thanks Again
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Save As and Compile Inconsistency corwinckler Bug Reports 0 01-14-2008 07:52 PM
save filter of a table manu Questions & Help Needed 4 08-23-2007 04:46 PM
How to save images after they have been placed in an imagelist XerVision Questions & Help Needed 2 07-13-2007 09:59 PM
somebody got an example load/save textfile? Stellaferox Questions & Help Needed 4 06-14-2007 06:05 PM
FTP library - won't getfile on PDA more than once mwaite Bug Reports 4 04-30-2007 03:37 AM


All times are GMT. The time now is 03:11 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0