Page 1 of 1

Calling SuperBasic from Archive

Posted: Tue Jan 26, 2021 7:25 pm
by SH1
Dear All,

Does anyuone know if there is any way of calling either SuperBasic or Machine Code from with an Archive procedure or interupt?

I am suspecting the answer is going to be no, but hoping someone might know :)

Regards
Simon

Re: Calling SuperBasic from Archive

Posted: Tue Jan 26, 2021 7:51 pm
by NormanDunbar
SuperBasic, no.
Assembly, maybe...

Not from archive itself, but there was another application named, I think, Archive Run Time, or similar. I seem to remember a review which mentioned being able to call assembly from that.

HTH and apologies for the vagueness!

Edit: https://qlwiki.theqlforum.com/doku.php?i ... devarchrtm

Cheers,
Norm.

Re: Calling SuperBasic from Archive

Posted: Tue Jan 26, 2021 8:07 pm
by SH1
Good evening Norm,

Ah, this is great, thank you. I had not thought of using this, as I only use Archive in its original form.

Shall have a play to-morrow and let you, if what I want to do is possible.

Regards
Simon

Re: Calling SuperBasic from Archive

Posted: Tue Jan 26, 2021 8:34 pm
by dilwyn
To expand on what Norman said, have a look at the Runtime Archive, manual and an example from Tony Firshman, on my site at http://www.dilwyn.me.uk/psions/index.html

It's near the bottom of the page, under '"Runtime QL Archive".

I've copied the following notes from the manual so you can get an idea of whether it'll do what you want:
4) Machine code interface

The Archive RTM and the full version of Archive provided with it support the use of machine code routines. They are interfaced to an Archive program by means of an additional usr() function and a usr qualifier to the Load command.

The machine code must be relocatable, that is, it must use only PC-relative addressing modes. In addition to the code, the file must contain a six-byte header. Bytes 0 to 3 must contain "pmcO" and bytes 4 and 5 must: be a word giving the length of the following code. It is the user's responsibility to ensure that the file has the correct header.

The machine code program (in image form, exactly as it would appear in memory) must follow the header, with its entry point at the byte immediately following the header. The code must end with a return from subroutine instruction.
Archrtm is the 'runtime' version, while Archdev is the full version, both are in the package.

The manual includes an example of how to play a simple beep sound from Archive.

Re: Calling SuperBasic from Archive

Posted: Tue Jan 26, 2021 8:42 pm
by SH1
Good evening Dilwyn,

Thank you !

Some light reading for the Home Office :D

Regards
Simon

Re: Calling SuperBasic from Archive

Posted: Wed Jan 27, 2021 9:20 am
by Derek_Stewart
Hi,

I think this really hard to access SuperBASIC from Archive.

Archive has a programming language built into the application, which usually suits the average Archive user.

I offten thought about a SuperBASIC version of the Archive Database., but the effort is not really worth doing.

Maybe a better idea is to use the DBAS database extensions to SuperBASIC and SBASIC which extend the QLs programming environment. An application written in S*BASIC could be written and compiled with Qliberator very easily.

There are exisiting free application that will read DBAS dtat files: QBASE, Suqcess and the DBAS applications in the package.

Re: Calling SuperBasic from Archive

Posted: Wed Jan 27, 2021 9:51 pm
by SH1
Good evening Derek,

Many thanks for the tip. Agreed, the procedure language in Archive is actually quite good, but I have a problem with date manipulation.

For instance, I can not subtract 30 days from to-day's date and then display it as 28/12/2020.

I thought I could deploy a user-exit into SuperBasic, but I have now been playing with ARCDEV/RTM and shall see if I can get around it via this method.

Regards
Simon