Page 1 of 1
Sample Database Application for Programmers new to PureBasi
Posted: Wed Jul 01, 2020 7:43 pm
by jcaceres
Hello. nice meeting you. I'm starting to learn the language. I was looking for some postgres sample and found this thread, tried to get purebasicdatabaseapp.zip but the server is not online. Could you please help me to find another resource to get this.
Regards.
Re: Sample Database Application for Programmers new to Pure
Posted: Wed Jul 01, 2020 10:28 pm
by Kiffi
Possible spam. See here:
viewtopic.php?p=556913#p556913
If he does not respond in a few days, this thread will be deleted and the user will be banned.
Re: Sample Database Application for Programmers new to Pure
Posted: Thu Jul 02, 2020 1:19 am
by AMpos
The "Turing's test" will be useless in a few years, and we will have to switch to "Voight-Kampff test" to find bots...
Re: Sample Database Application for Programmers new to Pure
Posted: Thu Jul 02, 2020 7:10 am
by C87
Hello jcaceres
Search in topic titles for : YADA - Yet another database application
viewtopic.php?f=27&t=72485&hilit=YADA+Y ... pplication
This is a good example of a database application written in PureB. There will be aspects of it that
as a new user you may find puzzling at first sight. It uses PureB functions and methods that a new
user would skate past or ignore in order to get something up and running as soon as they can. The
naming system used, whilst being Ok, can be confusing. For instance, if I remember correctly the
Database and Table name used are the same. It splits the application into modules and you will
need to locate where variables and references are initialised. You should take the time to understand
just how this is working before you even think of adapting it to your way of working. There are a few
bugs in it but they do not prevent it from working, or divert from its operation. As you know there
is nothing worse than an example program that falls over when you are starting out in a new language
and still thinking in your old one! This is a very good example to start with. Basically allow plenty of
time to understand how it has been created and how it is working before attempting any changes.
You will need to spend some time in the PureB HELP file. It also uses SQLite, which is good if you
haven't used that before. Have fun!

Re: Sample Database Application for Programmers new to Pure
Posted: Thu Jul 02, 2020 8:29 pm
by jcaceres
thnks C87, but it seems the location of the file is offline.
Re: Sample Database Application for Programmers new to Pure
Posted: Thu Jul 02, 2020 8:50 pm
by jcaceres
THANK YOU C87
I WAS ABLE TO DOWNLOAD IT. MY MISTAKE. WAS CHECKING ON AN OLDER POST.
It works fine now. thanks a lot.

Re: Sample Database Application for Programmers new to Pure
Posted: Thu Jul 02, 2020 9:37 pm
by kpeters58
Hi C87,
now if I can only get you to post these bugs you have found under my YADA topic.
They will never get fixed if you keep them to yourself. Look forward to rooting them out!
Cheers,
Kai
Re: Sample Database Application for Programmers new to Pure
Posted: Fri Jul 03, 2020 7:47 am
by C87
HI kpeters58, The one I remember is in the Add/Edit module - form_Contact.pbi
Nothing major but easily fixed.
If you have selected add a new record, add the record, then Save and without closing make changes
to that new record, then click Save again. It will add another new record with those changes. So
you end up with two nearly identical records. One the original Add & one the modified Add.
All it needs is a switch from the ADD to EDIT variable after adding. I thought a good one
for anyone going through it would easily fix! Mmm, that's odd...two the same. Why is that?
Cheers, C87
Re: Sample Database Application for Programmers new to PB
Posted: Wed Jul 08, 2020 10:02 pm
by kpeters58
Hi C87,
that's actually a 'feature' (which can be turned off in the configuration -> 'Auto-close contact form on save'):
If you wanted to add a whole family to your contacts (say, all living at the same address) you could just enter the first one, hit [Save], modify the First Name field, hit [Save] again and so forth.
So that's definitely intentional.
What is missing, however, is enforcing uniqueness among contacts (as far as that is possible, depending on which entry fields you make mandatory).
To that end, the next version of YADA I am about to release will introduce unique constraints at the SQLite level for both phone numbers and email addresses, as well as for a combination of first- & last name, address & city. It will also be a dual-language release (German & English), switchable at runtime