Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Share Your Creations
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Share Your Creations Show your developed application to Basic4ppc community. Please include source code if possible.


B4PPC Backup utility v1


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-08-2007, 01:17 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,463
Awards Showcase
Forum Contributer 
Total Awards: 1
Default B4PPC Backup utility v1

Hi guys..
After yesterdays fiasco I went back to the drawing board and re-think my simple backup utility, and I am now happy to say that it is working....

First things first...

Execute Backup.exe ...

A form Pops with 3 basic inputs:

The file Extension you want your backups to have...
The number of Backups to keep
And the Folder in wich they will be created...

All these can be altered in the sbp file and the just re-compile it...
I hadded just a few basic ones in order to have a practical running app....

How to backup?

From your currently developing app add this line of code.

Shell("Backup.exe", YourFileName) You should replace YourFileName by the name you want the backups to have...

The utility Then creates a backup Folder based on the ini file, with the extension defined in the ini file and keeps the number of backups defined in the ini file...
Attached Files
File Type: zip Bakup.zip (57.1 KB, 65 views)
__________________
Paulo Gomes
Porto, Portugal

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

DLL Version Listing
Reply With Quote
  #2 (permalink)  
Old 07-08-2007, 03:26 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,900
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hi Cableguy - I hope that you won't take this the wrong way, I want to educate not criticise, but as a software engineer could I make a couple of points regarding programming style

I don't think that "FileSearch" is guaranteed to return the filenames in any particular order as you are assuming, so it would be good programming practice to add a "nrfiles.Sort(cCaseSensitive)" line to your code after "FileSearch". This ensures that you know what order the filenames are in. This is called "defensive programming" where you add code to check what you are not already sure of. This change probably also means that you will have to reverse the order of your delete and copying as I think that the sort order of an ArrayList may be ascending.

Also, depending upon how the string sort is done your backup order may break if a user ever wanted 10 or more backups as File12.bak may sort before File2.bak. I haven't checked this on B4PPC but it is the principle I am commenting on. Defensive programming would add a maximum (and minimum) check so that all the names that could ever possibly be produced are guaranteed sortable correctly.

Also "goto" is normally regarded as anathema in structured programming. It would be better programming style, and make your intentions easier for others to read, to abstract your your "CopyFiles" section to a sub of its' own.

I am afraid that you may think this is being pedantic, and maybe it is for a small program but think about how many traps, such as I've pointed out, you can lay for yourself with a larger application and how much debugging grief you can save by defensively programming in the first place.
Reply With Quote
  #3 (permalink)  
Old 07-08-2007, 09:59 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,463
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Thanks for the hints....

Althought the status say I'm a veteran it only reflects the number of post I have in this Great comunity, not my programing experience...
Still with B4PPC I've come to atlest be able to do a complete working program...With other languages, every time I got stuck there just wasn't anyone to turn to and ask....

I have said before, I hope to learn with others, and others experience in other languages and logical thinking...

In programing I'm a bit like a child playing with a bag of toys and don't relly know how to get to what I want...so I start coding and sometimes realize my aproach is wrong and restart...

I need to learn a bit more of programing logic, as in flowcharting the sequence of the code...and such...

Anyway I Thank you for having the time to look at my app, and hope it does what it was created to do....
__________________
Paulo Gomes
Porto, Portugal

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

DLL Version Listing
Reply With Quote
  #4 (permalink)  
Old 07-09-2007, 12:22 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,900
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

You post - I listen and comment if you are willing to to listen to what I say. I have been associated with computers for more than 40 years and over that time it has got more and more difficult for beginners to be able to get a start in programming as the complexity of being able to achieve anything worthwhile has increased. Despite the availability of the Express versions of Visual Studio (which are still a bit daunting for beginners) I think that Basic4PPC,which has a simplified programming model of the .NET framework, is a superb tool for starters -especially as it can target portable devices and enable development on the device. If I can at least help a few people to achieve something that they would otherwise not be able to achieve then I am happy,

Enjoy!
Reply With Quote
  #5 (permalink)  
Old 07-09-2007, 08:23 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,335
Default

agraham, if you don't mind I would like to show this quote on a new feedback page.
Reply With Quote
  #6 (permalink)  
Old 07-09-2007, 09:29 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,900
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Erel View Post
agraham, if you don't mind I would like to show this quote on a new feedback page.
No problem
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
Reminder utility agraham Code Samples & Tips 1 02-12-2008 03:49 PM
Desktop-only backup utility robmh Share Your Creations 1 11-03-2007 04:16 PM
Maintaining backup integrity agraham Share Your Creations 0 10-06-2007 06:38 PM
Utility Prog BPak Chit Chat 1 05-07-2007 06:57 AM
not b4ppc but the forum Cableguy Forum Discussion 1 04-29-2007 07:10 AM


All times are GMT. The time now is 06:16 PM.


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