Sample Database Application for Programmers new to PureBasi

Just starting out? Need help? Post your questions and find answers here.
User avatar
jcaceres
New User
New User
Posts: 5
Joined: Wed Jul 01, 2020 5:49 am

Sample Database Application for Programmers new to PureBasi

Post 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.
User avatar
Kiffi
Addict
Addict
Posts: 1485
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Sample Database Application for Programmers new to Pure

Post 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.
Hygge
AMpos
Enthusiast
Enthusiast
Posts: 128
Joined: Fri Jun 05, 2020 12:47 am

Re: Sample Database Application for Programmers new to Pure

Post 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...
User avatar
C87
Enthusiast
Enthusiast
Posts: 178
Joined: Mon Jul 17, 2017 7:22 am
Location: Cotswolds England

Re: Sample Database Application for Programmers new to Pure

Post 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! :lol:
If it's falling over......just remember the computer is never wrong!
User avatar
jcaceres
New User
New User
Posts: 5
Joined: Wed Jul 01, 2020 5:49 am

Re: Sample Database Application for Programmers new to Pure

Post by jcaceres »

thnks C87, but it seems the location of the file is offline.
User avatar
jcaceres
New User
New User
Posts: 5
Joined: Wed Jul 01, 2020 5:49 am

Re: Sample Database Application for Programmers new to Pure

Post 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. :lol: :-)
User avatar
kpeters58
Enthusiast
Enthusiast
Posts: 341
Joined: Tue Nov 22, 2011 5:11 pm
Location: Kelowna, BC, Canada

Re: Sample Database Application for Programmers new to Pure

Post 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
PB 5.73 on Windows 10 & OS X High Sierra
User avatar
C87
Enthusiast
Enthusiast
Posts: 178
Joined: Mon Jul 17, 2017 7:22 am
Location: Cotswolds England

Re: Sample Database Application for Programmers new to Pure

Post 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
If it's falling over......just remember the computer is never wrong!
User avatar
kpeters58
Enthusiast
Enthusiast
Posts: 341
Joined: Tue Nov 22, 2011 5:11 pm
Location: Kelowna, BC, Canada

Re: Sample Database Application for Programmers new to PB

Post 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
PB 5.73 on Windows 10 & OS X High Sierra
Post Reply