$$external problem
- Giorgio Garabello
- Gold Card
- Posts: 299
- Joined: Tue Jun 30, 2015 8:39 am
- Location: Turin, Italy
- Contact:
$$external problem
It's the first time I try to create a function using the $$ external Qliberator directive.
I copied the following sample program from the manual:
50 REMark $$ external
60 DEFine Function FRA (x)
70 RETurn x-INT (x)
80 END DEFine
I compiled it and then loaded it into memory using the LRESPR command.
When I try to run it
PRINT FRA (3)
hangs on the RETURN statement with the following error: "non-numeric string", then it crashes?
I'm doing the tests on QPC2 ...
Some idea?
I copied the following sample program from the manual:
50 REMark $$ external
60 DEFine Function FRA (x)
70 RETurn x-INT (x)
80 END DEFine
I compiled it and then loaded it into memory using the LRESPR command.
When I try to run it
PRINT FRA (3)
hangs on the RETURN statement with the following error: "non-numeric string", then it crashes?
I'm doing the tests on QPC2 ...
Some idea?
Quantum Technology
http://www.hunggartorino.it/ql/language/en/
http://www.hunggartorino.it/ql/language/en/
-
- Font of All Knowledge
- Posts: 4684
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: $$external problem
Hi Georgio,
You need to do your tests on a real QL or Q-emuLator, and you will get the expected answers.
Unfortunately, these QLIB externals will not currently work with QPC2.
What happens is that x gets the value of an empty string,
and INT expects a numeric value, so this causes the error,
but the function would not return anyway.
EmmBee
You need to do your tests on a real QL or Q-emuLator, and you will get the expected answers.
Unfortunately, these QLIB externals will not currently work with QPC2.
What happens is that x gets the value of an empty string,
and INT expects a numeric value, so this causes the error,
but the function would not return anyway.
EmmBee
- Giorgio Garabello
- Gold Card
- Posts: 299
- Joined: Tue Jun 30, 2015 8:39 am
- Location: Turin, Italy
- Contact:
Re: $$external problem
Damn!these QLIB externals will not currently work with QPC2
Are there any alternative ways to create extensions?
Quantum Technology
http://www.hunggartorino.it/ql/language/en/
http://www.hunggartorino.it/ql/language/en/
Re: $$external problem
Yes, in assemblerGiorgio Garabello wrote:Damn!these QLIB externals will not currently work with QPC2
Are there any alternative ways to create extensions?

Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
Re: $$external problem
What is the technical reason for this?EmmBee wrote:You need to do your tests on a real QL or Q-emuLator, and you will get the expected answers.
Unfortunately, these QLIB externals will not currently work with QPC2.
- Giorgio Garabello
- Gold Card
- Posts: 299
- Joined: Tue Jun 30, 2015 8:39 am
- Location: Turin, Italy
- Contact:
Re: $$external problem
Assembler?....argh! (i'm ignorant)pjw wrote:Yes, in assemblerGiorgio Garabello wrote:Damn!these QLIB externals will not currently work with QPC2
Are there any alternative ways to create extensions?But why do you have to do this? It is no faster that incorporating the S*BASIC code in your (compiled) program. You could have a library of such toolkits and just paste them into your code as needed (as I do) or use Wolfgang's SBASIC linker..
I wanted to create a species of "API" to facilitate the work of other programmers ....
Quantum Technology
http://www.hunggartorino.it/ql/language/en/
http://www.hunggartorino.it/ql/language/en/
Re: $$external problem
The trouble is apparently caused by QPC2 not recognizing it has been called from the Interpreter's #0.Peter wrote:What is the technical reason for this?EmmBee wrote:You need to do your tests on a real QL or Q-emuLator, and you will get the expected answers.
Unfortunately, these QLIB externals will not currently work with QPC2.
The code will work if called from another compiled SBASIC Qliberator job, I've just tried this.
So, these QLIB externals do actually work with QPC2, but they currently cannot be used in Interpreted SBASIC.
EmmBee
-
- RWAP Master
- Posts: 2893
- Joined: Sun Nov 28, 2010 4:51 pm
- Location: Stone, United Kingdom
- Contact:
Re: $$external problem
Why not just leave the functions as SuperBASIC for people to incorporate within their own programs.Giorgio Garabello wrote: I wanted to create a species of "API" to facilitate the work of other programmers ....
They could be coupled with the QL Library Manager by Ergon Development - http://www.dilwyn.me.uk/program/index.html
Rich Mellor
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module - add a USB printer to your QL
Also Involved in:
Icephorm
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module - add a USB printer to your QL
Also Involved in:
Icephorm
- Giorgio Garabello
- Gold Card
- Posts: 299
- Joined: Tue Jun 30, 2015 8:39 am
- Location: Turin, Italy
- Contact:
Re: $$external problem
In my case it is an extension / command that acts in insertion on a Blackphonix system file ..RWAP wrote:Why not just leave the functions as SuperBASIC for people to incorporate within their own programs.Giorgio Garabello wrote: I wanted to create a species of "API" to facilitate the work of other programmers ....
They could be coupled with the QL Library Manager by Ergon Development - http://www.dilwyn.me.uk/program/index.html
I want to make sure everyone can take advantage of the service but that no one can enter data that is formally wrong.
I believe that alternatively I used an executable program.
Of course it would be interesting to solve the problem of extensions!
Giorgio
Quantum Technology
http://www.hunggartorino.it/ql/language/en/
http://www.hunggartorino.it/ql/language/en/