Small problem with QBase
Small problem with QBase
I've started using Qbase (a front end for DBAS files), and I really like this program for its simplicity and ease of use. The program's author is Daniel Baum, and the latest version I found on Dilwyn's website is version 1.01 from 2017.
The problem is that I see a small error in the "Select" option; the '=' and '<>' operators seem to be swapped. Also, the '<' and '>' operators. Luckily, the sources are available, and I've tried to correct the error on lines 5300 to 5330, to the best of my ability. With these small corrections, I can run the SuperBASIC program with lrun and everything works fine.
My problem is that I don't know how to compile a program with QLiberator when there are libraries or when the program is designed for PE.
The questions are:
Does anyone know how to compile this SuperBASIC program under PE? Or does anyone know if there's a newer version with this minor fix? Or would anyone know how to contact Daniel Baum to see if there's a newer version?
The problem is that I see a small error in the "Select" option; the '=' and '<>' operators seem to be swapped. Also, the '<' and '>' operators. Luckily, the sources are available, and I've tried to correct the error on lines 5300 to 5330, to the best of my ability. With these small corrections, I can run the SuperBASIC program with lrun and everything works fine.
My problem is that I don't know how to compile a program with QLiberator when there are libraries or when the program is designed for PE.
The questions are:
Does anyone know how to compile this SuperBASIC program under PE? Or does anyone know if there's a newer version with this minor fix? Or would anyone know how to contact Daniel Baum to see if there's a newer version?
-
- Font of All Knowledge
- Posts: 4650
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: Small problem with QBase
Hi,
Daniel, is a member on the Forum, there is a new version of Qbase, see : viewtopic.php?p=29094&hilit=qbase#p29094
Daniel, is a member on the Forum, there is a new version of Qbase, see : viewtopic.php?p=29094&hilit=qbase#p29094
Regards,
Derek
Derek
- NormanDunbar
- Forum Moderator
- Posts: 2450
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: Small problem with QBase
There's actually a bug in DBAS on the select function, I think. The docs say to do one thing, but the C68 library does the opposite. This reverses the result so the records you want to select are not, but the ones you didn't want, are! It is also intermittently working if you use the internal comparison routines. I had to write a user compare function when I converted the Quanta Library to use DBAS, because select was pants.afx wrote: Sun Mar 16, 2025 7:32 pm The problem is that I see a small error in the "Select" option; the '=' and '<>' operators seem to be swapped. Also, the '<' and '>' operators.
I'm doing a bit of DBAS in Assembly ATM, and I'm seeing the same intermittently there too with the internal compare functions.
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.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Re: Small problem with QBase
Can you be more specific?NormanDunbar wrote: Mon Mar 17, 2025 6:01 amThere's actually a bug in DBAS on the select function, I think. The docs say to do one thing, but the C68 library does the opposite. This reverses the result so the records you want to select are not, but the ones you didn't want, are! It is also intermittently working if you use the internal comparison routines. I had to write a user compare function when I converted the Quanta Library to use DBAS, because select was pants.afx wrote: Sun Mar 16, 2025 7:32 pm The problem is that I see a small error in the "Select" option; the '=' and '<>' operators seem to be swapped. Also, the '<' and '>' operators.
I'm doing a bit of DBAS in Assembly ATM, and I'm seeing the same intermittently there too with the internal compare functions.
Cheers,
Norm.
There is no SELECT keyword in DBas so I assume you mean EXCLUDE, INCLUDE or SEARCH. I have not found any of these problems there while working on and with SuQcess for 25 years.
Could it be that the problem is in the C68 part (not used in SuQcess) and not in DBAS?
There is another DBAS problem once you create over 200 fields. In theory the limit is 255 but it seems to loose track of them well before that.
BSJR
- NormanDunbar
- Forum Moderator
- Posts: 2450
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: Small problem with QBase
I can indeed be specific.
When I wrote the Quanta LibGuide using DBAS way back min 1992, on DBAS version 1.x, I had to write a user selection function to allow the "select" function to be used. This was because the C68 function fsd_incld() didn't work. In order to include the records I wanted, I had to fsd_excld() the ones I didn't want using a user function, C68 library doesn't let the internal comparaison function be used---see later.
I have this comment in the libselect.C file:
The c68 function mentioned use the underlying assembly functions fsd.sel function with a parameter list as follows:
There can be up to 4 conditions.
This piece of assembly code, running against the Quanta libguide database is not working:
Here I'm asking for all the records with disc name "UG 04" to be included. I get zero records. If I change "selectInclude" from 64 to zero, I get records selected. However, I I try with another disc name instead of "CG 04" I get a whole lot more records, the vast majority are not for the disc I'm "selecting" for inclusion.
The C68 functions are in the file "fsdsel.s" which looks like this:
The parameter bit 6 settings match the docs. If the user function passed is zero, all records are selected or unselected depending on the function called. The user function has to do the compare as it doesn't appear that the internal compare function can be used.
I'm currently using DBAS version 2.13 if that makes any difference?
I am in the process of attempting to get a minimal working program so that I can test this out further.
HTH
Cheers,
Norm.
When I wrote the Quanta LibGuide using DBAS way back min 1992, on DBAS version 1.x, I had to write a user selection function to allow the "select" function to be used. This was because the C68 function fsd_incld() didn't work. In order to include the records I wanted, I had to fsd_excld() the ones I didn't want using a user function, C68 library doesn't let the internal comparaison function be used---see later.
I have this comment in the libselect.C file:
Code: Select all
/*------------------------------------------------------*
* Very strange, I have to EXCLUDE records I don't want *
* as INCLUDING those I do want, doesn't work ! *
* *
* If any records are selected, position at the first, *
* otherwise perform an automatic reset. *
*------------------------------------------------------*/
Code: Select all
Byte 0: Bit 7 clear = use internal compare, set = use user supplied compare.
Bit 6 clear = exclude selected records, set = include selected records.
Bits 5-0 = unused.
Byte 1: How many parameters follow.
then, each parameter:
0.W = Field number.
2.B: 0 = field greater than; 1 = field equals; 2 = field less than.
3.B = Unused.
4.L = Offset of comparison data from start of parameter list.
8.W: 0 = no more parameters; 4 = OR this parameter with next; 8 = AND this parameter with next; $C = XOR this parameter wit next.
This piece of assembly code, running against the Quanta libguide database is not working:
Code: Select all
selectInclude equ 64 ; Bit 6 is set, should include records.
...
gg01Select
dc.b selectInclude ; Include records which match.
dc.b 1 ; One parameter.
dc.w 1 ; Field = Disc Name.
dc.b 1 ; Must be equal.
dc.b 0 ; Unused.
dc.l gg01Data-gg01Select ; Offset to data.
dc.w 0 ; No more parameters.
gg01Data
dc.w 5
dc.b "UG 04"
The C68 functions are in the file "fsdsel.s" which looks like this:
Code: Select all
.text
.even
.globl fsd_excld
.globl _fsd_excld
.globl fsd_incld
.globl _fsd_incld
; C library modules - Database handler
fsd.sel equ $40
; Routine to perform include/exclude from a database
; short fsd_excld(long dbid, char routine, void application)
; short fsd_incld(long dbid, char routine, void application)
; routine = 0 for all
; return recnum / -1
fsd_excld:
_fsd_excld:
moveq #0,d0 ; do exclude (byte 0, bit 6 clear)
bra fsd_sel
fsd_incld:
_fsd_incld:
move.w #$4000,d0 ; do include (byte 0, bit 6 set)
fsd_sel:
link a6,#0
movem.l d1/d7/a0-a2,-(a7)
move.l 8(a6),a0 ; get database ID
move.l __database,a2 ; get database VBR
; Call the database package
lea __fsd_sel,a1 ; parameter block
move.w d0,(a1) ; store ex/include flag & no params
move.l 12(a6),d7 ; routine ptr / 0
beq call ; do all if ptr 0
bset #7,(a1) ; signal user routine
;
call:
jsr fsd.sel(a2)
move.l d0,_dberr
move.l d0,_oserr ; set error
beq ok
moveq #-1,d0
bra fin
ok:
move.w d1,d0
fin:
movem.l (a7)+,d1/d7/a0-a2
unlk a6
rts
I'm currently using DBAS version 2.13 if that makes any difference?
I am in the process of attempting to get a minimal working program so that I can test this out further.
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.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Re: Small problem with QBase
Thanks Derek, for the links. I've tried version 1.02, but the problem is the same.Derek_Stewart wrote: Sun Mar 16, 2025 8:27 pm Daniel, is a member on the Forum, there is a new version of Qbase, see : viewtopic.php?p=29094&hilit=qbase#p29094
Hi Norman, that's exactly what I get with QBase's "Select" option.NormanDunbar wrote: Mon Mar 17, 2025 6:01 am There's actually a bug in DBAS on the select function, I think. The docs say to do one thing, but the C68 library does the opposite. This reverses the result so the records you want to select are not, but the ones you didn't want, are!
Re: Small problem with QBase
Thanks Norman.NormanDunbar wrote: Mon Mar 17, 2025 3:41 pm I can indeed be specific.
(...very specific...)
I'm currently using DBAS version 2.13 if that makes any difference?
I am in the process of attempting to get a minimal working program so that I can test this out further.
HTH
Cheers,
Norm.
As I indicated, for SuQcess we only use the Basic keywords and no reversing of compare type is needed.
All 4 terms can be used with AND, OR, XOR & NOT and have been used on the Quanta Lib database as well.
(See the image on the site): https://home.hccnet.nl/b.spelten/ql/suqcess2.html
I am not familiar with C68 so this needs more study.
The DBAS as supplied with SuQcess is version 2.13md2. The "md2" stands for mod-2, a minor name change to make sure its RESET command does not reset SMSQe but only the record selection. The keyword is DBRST now.
BSJR
- NormanDunbar
- Forum Moderator
- Posts: 2450
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: Small problem with QBase
Does anyone have the source code for DBAS versions 2.12 or 2.13 please? I don;t have time to disassemble it to work out what the hell is going on in the fsd.sel function. There's a serious bug in there as it is definitely not working according to the docs, and even worse, is returning complete garbage for many of the selections, but correct results for other stuff.
I'm going bonkers here trying to figure it out and I need the code to check what is happening.
Thanks.
Cheers,
Norm.
I'm going bonkers here trying to figure it out and I need the code to check what is happening.
Thanks.
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.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Re: Small problem with QBase
The original sources were on Quanta Library disc SP08, but were a couple of versions older than you have.
DBAS 2.11 on The Library disc SP62, 2.12 and 2.13 were on The Library disks P64 and P85. Don't know if they included sources, sorry.
Edit: sorry about the fat fingered typing on my phone first time round.
DBAS 2.11 on The Library disc SP62, 2.12 and 2.13 were on The Library disks P64 and P85. Don't know if they included sources, sorry.
Edit: sorry about the fat fingered typing on my phone first time round.
--
All things QL - https://dilwyn.theqlforum.com
All things QL - https://dilwyn.theqlforum.com
-
- Font of All Knowledge
- Posts: 4650
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: Small problem with QBase
Hi,
The problem with DBAS, was the source code was not supplied. I am sure, I may of disassembled DBAS, I used to disassemble everything to learn how to program in assembler.
I will look at my backup files.
The problem with DBAS, was the source code was not supplied. I am sure, I may of disassembled DBAS, I used to disassemble everything to learn how to program in assembler.
I will look at my backup files.
Regards,
Derek
Derek