Code snippets

Discussion in 'Share Your Creations' started by tremara1, Jan 1, 2009.

  1. tremara1

    tremara1 Active Member Licensed User

    I got sick of hunting around for bits of code I use over and over so I created a small repository to store bits and pieces of code in one place. I have included a field to attribute the code to the author where it is known. It is very simple but (for me) a highly useful tool. It is a desktop tool. Hope it works for you pls let me know of any problems.
    Ballarat Victoria Australia
    Last edited: Jan 14, 2009
  2. HomeWorx

    HomeWorx Member Licensed User

    Great tool !
    Should be included into B4ppc's main window - there's plenty of room in the toolbar...
  3. digitaldon37

    digitaldon37 Active Member Licensed User

    Thanks for sharing - this is an excellent tool. If I could make one suggestion, I would add categories to help organize the snippets.
  4. tremara1

    tremara1 Active Member Licensed User


    I have uploaded another version I have added info data in the db. I also added a search box. It also corrected a problem with last item deleted. Also a record number label. Uploaded file on original post.

    Hope it helps......
  5. tremara1

    tremara1 Active Member Licensed User

    Another Update

    Just a small update with forward and back buttons for navigation. Also added close connection on close which I missed earlier. Updated file on original post.

  6. Mr_Gee

    Mr_Gee Active Member Licensed User

    nice :)
  7. dennishea

    dennishea Active Member Licensed User

    Hi tremara1.

    In your database 7/7 has name strToUpper and the snip is StrToLower. What is the sequence to edit and change snip to StrToUpper.

    edit: :signOops: on my part, sorry.

    Denny :) :sign0188:
    Last edited: Jan 5, 2009
  8. tremara1

    tremara1 Active Member Licensed User

    wrong snippet

    The database included with this code is the one I used when developing app, it is not intended to be used as gospel. I was pasting all sorts of stuff so any of these can be off a bit. Just delete the record and redo it, and add all your own stuff. I will be interested to see some of the databases you guys fill. I did not allow changing of the snippet name/description in the edit screen, I will look at adding this.

    hope you are finding it useful.....
  9. Mr_Gee

    Mr_Gee Active Member Licensed User

  10. tremara1

    tremara1 Active Member Licensed User

    future features

    Mr_Gee, thanks for your input, I am currently looking at adding category field this might go some way to narrowing selections.....

  11. N1c0_ds

    N1c0_ds Active Member Licensed User

    This project needs to be pursued, nice job!
  12. tremara1

    tremara1 Active Member Licensed User

    Snippets update

    I have uploaded an updated version on the original post with some changes such as search by category, add new category as well as fixing some minor bugs to do with label text on add/edit form. I have also done some cosmetic changes moved the controls around a bit and added a logo. I also put a flashing label on the edit / add form to indicate what mode you are in, it is a bit annoying but I did it because I wanted to experiment with the timer control. Keep on coding.......
    Ballarat Victoria Australia
  13. tsteward

    tsteward Active Member Licensed User

    Unfortunately there is an error.
    I just downloaded and ran and get "no such table: cats" error
  14. klaus

    klaus Expert Licensed User

    Me too !

    The Caregory label should be Category and moved a bit to the left.

    Best regards.
  15. tremara1

    tremara1 Active Member Licensed User


    Sorry guys I added a table to the db but forgot to put the new one in the zip. I have uploaded another version, I also corrected the spelling. I cant believe I spent so much time looking at it and did not see it......have another look now

    Ballarat Victoria Australia
  16. tremara1

    tremara1 Active Member Licensed User

    Another Update again

    Am I just a crap coder, I just found another little issue with some imagebuttons I used as labels, I forgot to make them inactive. Not a biggy but I thought I had it this time. I bet it is not the last.....hope you don't give up on me.....
    PS I have uploaded the latest attempt to the original post(again).
    Ballarat Victoria Australia
  17. N1c0_ds

    N1c0_ds Active Member Licensed User

    I made so many little errors too in the past (as to look old and talented :rolleyes:), but I now triple-check my code, optimize it (complete rewrite) at least once every new release and I make sure to test everything. I had to reupload the first Gecko many times before it really worked because I didn't bother testing the installer.

    It's only habits, you're not a bad developer! :sign0188:

    As for the application, here's a few code snippets that MUST be added:
    -DownloadFile (in HTTP lib docs)
    Sub CheckConnection(URL)
      Response.Value = Request.GetResponse
    Return True
    Return False
    End Sub
    I'll also post a few snippets myself from the Gecko source code. I made one that can resize pictures so it fits the image without stretching and I have a few cool bits to spot connection problems, show error messages etc etc..

    It would be nice to have a second textbox that describes the variables and the libraries required.
  18. tremara1

    tremara1 Active Member Licensed User

    N1c0_ds...thanks for the encouragement It is really difficult to test every scenario when you start to get away from the really simple code. I have just found another little issue that let you add a blank new category..cured with a simple 'if then'. This forum is great as it gives all the extra eyes and systems for the testing after you get as far as you can when developing.
    I have uploaded a new version on the original post.

    Ballarat Victoria Australia
  19. digitaldon37

    digitaldon37 Active Member Licensed User

    Thanks for the category.

    If I could make a suggestion, I would either sort the combo list (should be able to set that with the door library) or sort the table. Or you could use agraham's collection library which has a sorted list.
  20. tremara1

    tremara1 Active Member Licensed User

    All sorted

    digitaldon37, good idea I have used the 'order by' parameter in my sql statements this seems to have done the job.......another uploaded version is on the original post...

    Ballarat Victoria Australia
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice