Simple File Cabinet

Post

Posted
Rating:
#1 (In Topic #348)
Avatar
Regular
cage is in the usergroup ‘Regular’
 This is a simple file cabinet program that allows you to setup categories and place information in those categories.  Included is brief instructions on the menu items.  I wanted a data base program that didn't require MySql to make it usable.  Just a very simple data base program.

Attachment
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Regular
stevedee is in the usergroup ‘Regular’

cage said

This is a simple file cabinet program that allows you to setup categories and place information in those categories…

I've only had an hour or so to look at this, but hope to spend some more time later.

Initial impression: I like it!

Comments;
1. I'd prefer 'right-click' to bring up the option for adding a New Category rather than Delete a category. I think deleting should be more difficult/less immediate, so better in the dropdown menu.

2. I think you need to swap the last two lines in FMain.class Public Sub mnuNew_Click() so that the category list updates straight away, without having to manually refresh, like this:-

Code (gambas)

  1. Public Sub mnuNew_Click()
  2.  
  3.   Dim value As String
  4.  
  5.   value = InputBox("Enter Name for File:", "Category Name", "Do not know")
  6.  
  7.   If value = "" Or value = "Do not know" Then
  8.     Message("New Entry Aborted ")
  9.     Return
  10.  
  11.   Mkdir Application.path &/ value
  12.   Form_Open()
  13.  

3. There is quite a bit of duplication in Contents.class Select Case. Duplication is more bug prone, and can have a negative affect on software maintenance and test time.

I suggest some kind of "CreateCat" routine, maybe like:-

 

Code (gambas)

  1. Public Sub CreateCat(strMsg As String)
  2.  
  3.      Kill Application.Path &/ Global.GCat &/ Global.GName
  4.      hFile = Open Application.Path &/ Global.GCat &/ Global.GName For Create
  5.      Message(strMsg)
  6.      File.Save(Application.Path &/ Global.GCat &/ Global.GName, TextArea1.Text)
  7.      Close #hFile
  8.      Global.GNew = True
  9.      Me.Close
  10.      CatData.Show    
  11.  

…actually the:-

Code (gambas)

  1.      Me.Close
  2.      CatData.Show
  3.  
…should just appear once, below End Select (…if this is not a problem for the Case "Print").

I hope this is useful.

EDIT

4. The Print Selected Text form is not very well behaved. I think you should use:-

Code (gambas)

  1. PrintForm.ShowModal
…to ensure it comes up on top and cant be ignored until its been dealt with by the user.
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Regular
cage is in the usergroup ‘Regular’
 Good call Stevedee I will implement those changes and see how well they work.  I am always open to suggestions on how to improve my programs.  Thank you very much.
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Guru
cogier is in the usergroup ‘Guru’
Hi cage. Here is my 2 pence worth, or in your case 'cents'.

I have made all the forms expandable added the logo to FMain form so it shows in the taskbar. The only other issue that I noticed was the use of the word 'Exit' I kept thinking that would exit the program. I think 'Close' might be better. Other than that it seems to work well.  :arrow:  BUT what did I see!! Was that references to VB6!! Ahh!!  :shock:

Attachment
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Regular
cage is in the usergroup ‘Regular’
 LOL Charlie, yes I was a VB programmer since the first version came out.  I have programed using VB through all the version until they came out with VB Net.  Didn't like VB Net at all.  When I went to Linux I started to use Gambas in which my VB skills could adapted.  While I am not an expert in Gambas I am learning more and more all the time with help form people like you and stevedee.  I have implemented everything that stevedee and you suggested in the latest version.  So hope you like the program.
Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Regular
stevedee is in the usergroup ‘Regular’

cage said

…until they came out with VB Net.  Didn't like VB Net at all…
Me too. When still working in industry, I enjoyed VB6, didn't like .Net, and really didn't like C++.  I also discovered the delights of VBA for Excel, creating an OPC server/client system for an Irish cheese products company. Its good for many applications which produce a lot of data and where you can't be bothered to create a user interface (i.e. just write any data to a spreadsheet).
Online now: No Back to the top

Post

Posted
Rating:
#7
Avatar
Regular
stevedee is in the usergroup ‘Regular’

cage said

…I have implemented everything that stevedee and you suggested in the latest version.  So hope you like the program.

Great stuff cage, I think that is an improvement.

Just a few more points (sorry);

1. I think you may have forgotten to add the Delete Category option to the drop-down menu.

2. Whenever you do anything with files (e.g. open, create, kill…) you should add an error handler. So the minimum would be just to add Catch as you have done in many routines. Or maybe even use the Try…If Error method.

3. With Select Case, its a good idea to always use the Case Else condition (just in case none of the cases apply). So in the Contents.class I would replace the Case "exit" with Case Else.

4. Not sure what the Return is doing in this bit of code:-

Code (gambas)

  1.   Message.Title = "Error"
  2.  

…but I expect its just a remnant from an earlier edit.

5. In the Sub mnuDelete_Click() routine you have an unnecessary Return, which for me is ugly (…yes, I'm a bit of an old woman). This routine could easily be re-written so that Return is not necessary. Also, a '2 Case' chunk of code can always be replaced by an If…Then…Else block which in this case would make it easier to read.
Online now: No Back to the top

Post

Posted
Rating:
#8
Avatar
Regular
cage is in the usergroup ‘Regular’
 stevedee I also programed in C.  However lost interest as the newer versions came out.  Anyways I made the changes you suggested except the if statements and found one problem caused by my updates which I fixed.  Steve is there a way to delete the previous versions from the board as I don't want to clog up you disk space with older versions.  The latest version is now in the first post above.
Online now: No Back to the top

Post

Posted
Rating:
#9
Avatar
Administrator
sholzy is in the usergroup ‘unknown’
 To edit a post, go to that post and look at the top right corner. You will see a pencil. Click on it. From there you can manage attachments and content (just like making an original post). When done, click "Submit".

Putting the newest version in your first post IMO would probably be the best location since new readers would always see the newest version right away, and thread followers would know right where to look for the newest version.

sholzy
Gambas One Site Director

To report bugs in the Gambas IDE:
Official Gambas Bug Tracker
Online now: No Back to the top

Post

Posted
Rating:
#10
Avatar
Regular
cage is in the usergroup ‘Regular’
 Thanks Got2BeFree, I did it.  Stevedee thank you for you help.  I use to have a friend who would test out my programs and if there was a bug he would find it.  Unfortunately he passed away some years ago from cancer.  I miss him allot and he was a person the always pushed me into making my programs better.
Online now: No Back to the top
1 guest and 0 members have just viewed this.