Code snippets

tremara1

Active Member
Licensed User
Longtime 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.
tremara1
Ballarat Victoria Australia
 
Last edited:

HomeWorx

Member
Licensed User
Longtime User
Great tool !
Should be included into B4ppc's main window - there's plenty of room in the toolbar...
 

digitaldon37

Active Member
Licensed User
Longtime 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.
tremara1
Ballarat Victoria Australia

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

tremara1

Active Member
Licensed User
Longtime User
updated

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......
tremara1
Ballarat,Victoria,Australia
 

tremara1

Active Member
Licensed User
Longtime 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.

cheers.......
tremara1
Ballarat,Victoria,Australia
 

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:

tremara1

Active Member
Licensed User
Longtime 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.....
tremara1
Ballarat,Victoria,Australia
 

tremara1

Active Member
Licensed User
Longtime 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.....

tremara1
Ballarat,Victoria,Australia
 

tremara1

Active Member
Licensed User
Longtime 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.......
tremara1
Ballarat Victoria Australia
 

tsteward

Well-Known Member
Licensed User
Longtime User
Unfortunately there is an error.
I just downloaded and ran and get "no such table: cats" error
 

tremara1

Active Member
Licensed User
Longtime User
whoops

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

tremara1
Ballarat Victoria Australia
 

tremara1

Active Member
Licensed User
Longtime 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).
tremara1
Ballarat Victoria Australia
 

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)
-CheckConnection
B4X:
Sub CheckConnection(URL)
ErrorLabel(offline)
  Request.New1(URL)
  Response.New1
  Response.Value = Request.GetResponse
  Response.Close
   Return True
offline:
   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.
 

tremara1

Active Member
Licensed User
Longtime 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.

tremara1
Ballarat Victoria Australia
 

digitaldon37

Active Member
Licensed User
Longtime User
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.......
tremara1
Ballarat Victoria Australia

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.
 

tremara1

Active Member
Licensed User
Longtime 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...

tremara1
Ballarat Victoria Australia
 
Top