Knoware.no

Anything QL Software or Programming Related.
User avatar
pjw
QL Wafer Drive
Posts: 1622
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Knoware.no

Post by pjw »

RalfR wrote: Wed Feb 19, 2025 5:07 pm If you had described in more detail in your text what the program actually does, it would have been clear from the start.
Ah, thats the old "manual" problem. II thought I had! But I also wanted to keep it short and snappy, otherwise it wouldnt be read.

Finally, I didnt want to spend much time on something that I dont really believe in. The matter had been discussed on this forum, and so I assumed that those who are interested in this sort of thing would know what it was about.

Those who kicked up the biggest fuss about alternatives to Qliberated programs have shown no interest in any of the possible solutions. Obfuscater was part two of my reply..


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
Derek_Stewart
Font of All Knowledge
Posts: 4705
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Knoware.no

Post by Derek_Stewart »

Peter wrote: Sun Jan 12, 2025 9:01 pm
Derek_Stewart wrote: Sun Jan 12, 2025 8:18 pm The Configurable SuperToolkit II v2.06 is available on the QL Homepage.
But SuperToolkit II is TK3, not TK2. Configurable TK2 would be far more interesting.
Hi Peter,

Toolkit 3 was written by Ultrasoft, and later sold by Digitial Precision, an now is freeware.

Toolkit 3 is supposed to be an enchancement to Toolkit 2, but when I bought Toolkit 3, I did not like the it analysed the QDOS devices on initialisation.

But I disassembled Toolkit 3, made the Toolkit 3 initialisation simpler, it that it just added keywords to the QDOS/Minerva operating system


Regards,

Derek
Derek_Stewart
Font of All Knowledge
Posts: 4705
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Knoware.no

Post by Derek_Stewart »

Hi,

I must be one in a billion then, as I put REMarks in every programme I write even the boot file.

But I am just an ordinary user that has used the QL for nearly 40 years.

I maybe one that talks about Qliberator alternatives, nameley, Turbo, but I use both compilers.

I just want the Q60 to run Qliberator compiled programmes with the Cache on, which means to my limited programming ability, is to alter the Qliberator compiler. Which I will have to get my programming books out again and try and understand the programming of the Qliberaotr compiler.

But getting back on topic, I read the manual and I am not sure about the concept of obfuscater. Is not the idea to make every simplier or do I not understand as Obfuscation is the obscuring of the intended meaning of communication by making the message difficult to understand, usually with confusing and ambiguous language.


Regards,

Derek
User avatar
RalfR
QL Wafer Drive
Posts: 1182
Joined: Fri Jun 15, 2018 8:58 pm

Re: Knoware.no

Post by RalfR »

Derek_Stewart wrote: Thu Feb 20, 2025 7:22 amToolkit 3 is supposed to be an enchancement to Toolkit 2, but when I bought Toolkit 3, I did not like the it analysed the QDOS devices on initialisation.
I'd be happy to explain why and how this is the case, but I'll put that in a new thread; it doesn't really belong here.


7000 4E75
User avatar
pjw
QL Wafer Drive
Posts: 1622
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Knoware.no

Post by pjw »

Hi there!

I have been pretty lazy of late. Even so, here are a few more additions to Knoware, some scraped from the bottom of the barrel. Enjoy!

Please let me know if you discover any bugs, etc.


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
Derek_Stewart
Font of All Knowledge
Posts: 4705
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Knoware.no

Post by Derek_Stewart »

pjw wrote: Sat May 24, 2025 6:38 pm Hi there!

I have been pretty lazy of late. Even so, here are a few more additions to Knoware, some scraped from the bottom of the barrel. Enjoy!

Please let me know if you discover any bugs, etc.
looks great, I like the WHERE command, I can make good use of this.


Regards,

Derek
User avatar
pjw
QL Wafer Drive
Posts: 1622
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Knoware.no

Post by pjw »

Derek_Stewart wrote: Sat May 24, 2025 9:16 pm
pjw wrote: Sat May 24, 2025 6:38 pm Hi there!

I have been pretty lazy of late. Even so, here are a few more additions to Knoware, some scraped from the bottom of the barrel. Enjoy!

Please let me know if you discover any bugs, etc.
looks great, I like the WHERE command, I can make good use of this.
Thanks, Derek. Ive always found it useful. It was reading about qlfreak's struggles that finally made me decide to put it out there.


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
Popopo
Gold Card
Posts: 445
Joined: Wed Apr 07, 2021 10:37 am

Re: Knoware.no

Post by Popopo »

pjw wrote: Sat May 24, 2025 6:38 pm Hi there!

I have been pretty lazy of late. Even so, here are a few more additions to Knoware, some scraped from the bottom of the barrel. Enjoy!

Please let me know if you discover any bugs, etc.
Hi!
Nice and good site. :)
I have been checking some toolkits, specially ERRM$ since it could be helpful to me.
Not sure with the description if it does the job that I am expecting... I see it catch the Err message or it just show the message in the ROM for a specific Err?

In other words, When I execute a command from QDOS (or inside a SBasic program) like dir mdv1_ and there is not any cartridge, does it catch the err message allowing me to manage it? like inside a basic program doesn't return the control to the QDOS but continue with the next line?

I have read the ERRM.txt file, but I don't understand what it actually does.
Change the err message?
Redirect the code to another ram position instead ROM?
Function to return a standard error message as a string

Usage

string$ = ERRM$(<error code>)


Accesses the Qdos/SMSQ message table to return the message string
associated with the given error code, in the current language.

However, not all messages in the table are error messages, so other
messages (ie those without a termnating LF) will appear truncated. If a
suitable message for a given code cant be found, ie codes > 27 in Qdos,
"unknown message" is returned (in English!)

ERRM$ also supports the "special" error message convention:

Given a standard Qdos string in memory, its address, with the top bit set,
may be used as an error code. For example:

Code: Select all

10 adr = ALCHP(50)
20 POKESTR$ adr, 'Serious error here!' & CHR$(10)
25 er = adr + $80000000
40 PRINT ERRM$(er)
50 RECHP adr
REPORT er and ERT er will all return the same error message.
Sorry being so annoying :),
By the way... where is the Message table with the errs in the ROM?
I would like to catch those err messages from a Superbasic program in order to manage them (something like exception-catch from Java.) and don't loose the control that get me out from a SuperBasic code in execution to return to the QDos shell.


User avatar
pjw
QL Wafer Drive
Posts: 1622
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Knoware.no

Post by pjw »

Hi popopo!

Im sorry my manuals are so obtuse! I will try harder to make them clearer.

ERRM$ doesnt 'catch' anything. It simply returns the message associated with a given error code as a string. Then you can format the error message as you like, print it where you like, etc. You cant do that so easily with REPORT.

You, or your program, have to provide the error code by other means, for example:

PRINT ERRM$(-10)

Prints "End of file" or equivalent depending on your OSes language setting.

Or

Code: Select all

100 INPUT#0; 'Enter a file name'! fnm$
110 er = FTEST(fnm$)
120 IF er < 0 THEN
130  PRINT#0; 'Testing'! fnm$; ': Error ';
140  INK#0; 2: PRINT#0; ERRM$(er): INK#0; 4
150 END IF
Getting to the message tables: I wrote this so long ago, that I cant remember the details off the top off my head; the source code is there for your perusal! Otherwise I refer you to the SMSQ/E Reference Guide.

Basically, SMSQ/E has a method for getting the message tables; in Qdos you have to fiddle it out. Thats why there are two versions of the toolkit, one universal, and a more compact and sane version for SMSQ/E only.

You can also construct your own ad hoc messages. It works for any language, including BASIC, and works with all QL OSes. Simply poke the message string into some safe memory and return the address of the message with the top bit set. The function below does that. It is a bit convoluted, mainly in order to make it universal and easier to understand(!)

Code: Select all

10 er = MakeErr("This is an error!")
20 PRINT ERRM$(er): rem Requires my ERRM toolkit
30 REPORT er:		rem This one doesnt, only TK2
40 CLCHP
50 :
100 DEFine FuNction MakeErr(msg$)
110 LOCal i, l%, el%, a, m$, b$(32)
120 m$ = msg$ & CHR$(10):               REMark Termination EOL
130 l% = LEN(m$)
140 el% = (l% + 3) && -2:               REMark Make even
150 a = ALCHP(el%)
160 POKE_W a, l%:                       REMark String length
170 :
180 REMark Enter error message:
190 FOR i = 1 TO l%: POKE a + i + 1, m$(i)
200 b$ = BIN$(a, 32): b$(1) = '1':      REMark Set top bit
210 RETurn BIN(b$):                     REMark Return error "code"
220 END DEFine MakeErr
230 :
240 :


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
Derek_Stewart
Font of All Knowledge
Posts: 4705
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Knoware.no

Post by Derek_Stewart »

Popopo wrote: Tue May 27, 2025 8:50 am Hi!
Nice and good site. :)
I have been checking some toolkits, specially ERRM$ since it could be helpful to me.
Not sure with the description if it does the job that I am expecting... I see it catch the Err message or it just show the message in the ROM for a specific Err?

In other words, When I execute a command from QDOS (or inside a SBasic program) like dir mdv1_ and there is not any cartridge, does it catch the err message allowing me to manage it? like inside a basic program doesn't return the control to the QDOS but continue with the next line?
Hi

When there is no microdrive cartridge in the the drive, there should be a system error generated: ERR_NF (-7) file or device not found. See QDOS Technical Manual Chapter 18.1 Page 158 and SMSQ/E calls the error code: err.fdnf (-7) file or device not found, see SMSQDOS Reference Manual section 18.1

The error can be caught using a WHEN ERRor clause, see QL User manual or online Superbasic manual for details and Toolkit 2 and Qliberator manuals for updates.

Note pre-JS Roms the WHEN ERRor did not work, so, JS, Minerva, SMSQ/E are the only versions that will work.


Regards,

Derek
Post Reply