DBAS Database Documentation - Now available in PDF format.

Anything QL Software or Programming Related.
Post Reply
User avatar
NormanDunbar
Forum Moderator
Posts: 2488
Joined: Tue Dec 14, 2010 9:04 am
Location: Buckie, Scotland
Contact:

DBAS Database Documentation - Now available in PDF format.

Post by NormanDunbar »

I've been doing a bit of DBAS work in Assembly recently---for certain values of "recently"---and decided to convert the myriad of Quill files into a single PDF manual. It should be attached somewhere for your delectation and delight. ;)

I have still not tracked down why the FSD.SEL (Select records) function doesn't seem to work as documented, results are still fairly random no matter what I do. I will get to the bottom of it though.

Currently, using FSD.SEL works for some queries but not for others, or works partially, which is no good. In SuperBASIC (I'm told) and C68 (as I found out in 1993) in order to select records, you have to supply a user procedure and deselect all the records you don't want. This is arse about face!

Anyway, I hope the attached is useful. It's had a few minor corrections, but it's mainly as per the original docs.

EDIT 27 May. Due to a smattering of escape characters in some program listings, I've re-uploaded the document. If you see things like "flp1\_" then you should download the latest version. There should not be a backslash before the underscore. Apologies for the foul up, I didn't spot them in proof reading. Sigh.

EDIT 28 May. Fixed a typo. Added an explanation of how INCLUDE and EXCLUDE work to make it a lot less confusing as they are not exactly obvious, even though they could be. Fixed a type in the original example code in the doc for excluding dogs, cats and no pet people from a database of households!

DBAS.pdf
(468.19 KiB) Downloaded 29 times

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
Tesla
Brittle Membrane
Posts: 108
Joined: Fri Sep 15, 2017 6:19 pm

Re: DBAS Database Documentation - Now available in PDF format.

Post by Tesla »

A very useful job, Norman.
Thank you very much!
Greetings.
Marco


User avatar
NormanDunbar
Forum Moderator
Posts: 2488
Joined: Tue Dec 14, 2010 9:04 am
Location: Buckie, Scotland
Contact:

Re: DBAS Database Documentation - Now available in PDF format.

Post by NormanDunbar »

Thanks Marco.

Unfortunately, I've spotted a couple of foibles with the version you have downloaded. Please download again, I've uploaded a corrected version. See my original post for the problems.


Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
bwinkel67
QL Wafer Drive
Posts: 1539
Joined: Thu Oct 03, 2019 2:09 am

Re: DBAS Database Documentation - Now available in PDF format.

Post by bwinkel67 »

Found a typo in the May 2025 forward:
There are bugs in the record selection operation as described in the documentation.
I am working on finding out whet needs to be done or documented to fix it.
...and a blank page (16) which may be on purpose...dunno.

...and, this is a bit confusing:
INCLUDE #C;F,C$,V *;O$;F,C$,V*
INCLUDE #C
Select any record in which the given expression is true. If no extra parameters
are supplied, then the expression is always true, so all records are de( Or selected if
using EXCLUDE).

So if the expression is always true you de-select?

[Edit: Sorry, was really interested in how the BASIC interface worked so jumped right to the select part. Perhaps this is explained somewhere else in the manual]


User avatar
NormanDunbar
Forum Moderator
Posts: 2488
Joined: Tue Dec 14, 2010 9:04 am
Location: Buckie, Scotland
Contact:

Re: DBAS Database Documentation - Now available in PDF format.

Post by NormanDunbar »

bwinkel67 wrote: Wed May 28, 2025 6:08 am Found a typo in the May 2025 forward:


...and a blank page (16) which may be on purpose...dunno.

...and, this is a bit confusing:
INCLUDE #C;F,C$,V *;O$;F,C$,V*
INCLUDE #C
Select any record in which the given expression is true. If no extra parameters
are supplied, then the expression is always true, so all records are de( Or selected if
using EXCLUDE).

So if the expression is always true you de-select?

[Edit: Sorry, was really interested in how the BASIC interface worked so jumped right to the select part. Perhaps this is explained somewhere else in the manual]
Thanks, I'll fx it. There's always at least one typo! :(

Blank page is probably deliberate, but I'll check.
There's a section erlier explaining all the codes for those bits. I found them confusing too!

For INCLUDE with no params, select everything. For EXCLUDE with no params, deselect everything.

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
bwinkel67
QL Wafer Drive
Posts: 1539
Joined: Thu Oct 03, 2019 2:09 am

Re: DBAS Database Documentation - Now available in PDF format.

Post by bwinkel67 »

NormanDunbar wrote: Wed May 28, 2025 7:31 am For INCLUDE with no params, select everything. For EXCLUDE with no params, deselect everything.
That's what I would expect, but it seems to say the opposite...or am I just not getting the wording?


User avatar
BSJR
Trump Card
Posts: 222
Joined: Sun Oct 18, 2015 12:53 pm
Location: Amsterdam
Contact:

Re: DBAS Database Documentation - Now available in PDF format.

Post by BSJR »

bwinkel67 wrote: Wed May 28, 2025 10:57 am
NormanDunbar wrote: Wed May 28, 2025 7:31 am For INCLUDE with no params, select everything. For EXCLUDE with no params, deselect everything.
That's what I would expect, but it seems to say the opposite...or am I just not getting the wording?
This works as expected in S*Basic in my SuQcess program.
Norman's attempts in ASM appear to do it the opposite way.

Norman, thanks for the PDF.
The BIN supplied with SuQcess is v2.13md2 but I'm not sure what the difference is with 2.12.
I did rename the RESET keyword to DBRST to avoid an accidental OpSys reset, hence the 'md2'.
There are more generic names that may conflict with other toolkits so in most cases SuQcess uses the function keyword options like FDB_SET.

BSJR


User avatar
NormanDunbar
Forum Moderator
Posts: 2488
Joined: Tue Dec 14, 2010 9:04 am
Location: Buckie, Scotland
Contact:

Re: DBAS Database Documentation - Now available in PDF format.

Post by NormanDunbar »

Ok, here's an explanation of INCLUDE and EXCLUDE which I hope helps, because, as I've found, it's confusing!

I've added a better explanation to the SuperBASIC section on selecting records to make it less confusing, I hope. I also noted a typo in David Howell's original code in the example as it EXCLUDEs everything but staes that everything is INCLUDEd! Even he got confused. :D Once again, you are advised to grab the latest version in the very first post on this thread.


TL;DR

On opening a database, all records are included.

INCLUDE does nothing at this point, because INCLUDE only adds to the current list of included records by selecting a number of records from the currently EXCLUDED ones, to be henceforth, INCLUDEd. If you have nothing EXCLUDEd, then INCLUDE does nothing.

Example

Code: Select all

OPEN_DIN #3, "ram1_libguide_dbs"
:
REMark Record count.
PRINT COUNT(#3)
784

REMark Disc Name is field 1.
PRINT FETCH(#3, 1)
CD 01

REMark Exclude all "CD 01" records.
EXCLUDE #3; 1, "=", "CD 01"

REMark Record count.
PRINT COUNT(#3)
779

REMark Disc Name is field 1.
PRINT FETCH(#3, 1)
CT 01

REMark Only CD 01 records required.
INCLUDE #3; 1, "=", "CD 01"

REMark WRONG Record count!
PRINT COUNT(#3)
784

REMark Exclude everything that's NOT "CD 01" then!
EXCLUDE #3; 1, "<>", "CD 01"

REMark Record count.
PRINT COUNT(#3)
5

REMark ALTERNATIVELY...

REMark Exclude EVERYTHING
EXCLUDE #3
PRINT COUNT(#3)
0

REMark INCLUDE "CD 01" Only.
INCLUDE #3; 1, "=", "CD 01"
PRINT COUNT(#3)
5

CLOSE_DATA #3

In summary, if you wish to only have the records with disc name "CD 01" you must either:

EXCLUDE everything
INCLUDE the desired records

or

EXCLUDE everything except the desired records.



HTH

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Post Reply