Passing channels to jobs

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

Re: Passing channels to jobs

Post by pjw »

PS: Of course, JOB_NAME (line 160) doesnt work in compiled programs, youd need my QLIBJN command for that. PRTSTR% isnt available on Knoware.no as I didnt think it worthwhile, but QLIBJN is.


Per
dont be happy. worry
- ?
Tinyfpga
Gold Card
Posts: 252
Joined: Thu Sep 27, 2018 1:59 am

Re: Passing channels to jobs

Post by Tinyfpga »

As I only program for the Q68 and I only want to compile BASIC programs I decided to modify pjw's code so that it would compile.
After many failures (all sorts of things went wrong) I managed to compile one master and five slaves printing into the master's window and their own.

As pjw said, SMSQ/E was not designed to do this sort of thing but I think his function's are useful.
pjw's code seems to alter the characteristics of the pointer environment. Once the code is executing the the various windows (master and slave) can not be picked unless covered by another program's window excepting job 0's window.
pjw is correct in observing that the slaves regularly print characters incorrectly positioned in the master's window. I solved this problem
by clearing the receiving window every 2 seconds.

One other problem I struggled with was the fact that the new function PRTSTR% seems unable to print integer variables.
The function outputs an unprintable character if you try. I thus had to convert the integer into a floating point number.

The job and channel menus show that all is working as I would have expected. (see screen print below) I am now going to see if I can do anything useful with these
two new functions.
sms2.JPG


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

Re: Passing channels to jobs

Post by pjw »

Tinyfpga wrote:As I only program for the Q68 and I only want to compile BASIC programs I decided to modify pjw's code so that it would compile.
After many failures (all sorts of things went wrong) I managed to compile one master and five slaves printing into the master's window and their own.
Looks good ;)
As pjw said, SMSQ/E was not designed to do this sort of thing but I think his function's are useful.
pjw's code seems to alter the characteristics of the pointer environment. Once the code is executing the the various windows (master and slave) can not be picked unless covered by another program's window excepting job 0's window.
I think I said "probably". TT's CLOCK code demonstrates that he at least didnt think it "illegal" to write to another job's channel. I just think its not as efficient as it might have been had Qdos/SMSQ been designed for it. You see that when you try to do other things than print simple strings to a window (like simulating a dynamic sprite!..
I dont think the characteristics of PI are being changed, only that the system is too busy doing IO to respond to PI requests. This happens to some degree even when a single job is frantically outputting to its own window. For an easy-going update, like the timer in my D-Miner program, you can move the window around quite easily even though the timer is running. Of course, the timer and all other window IO is put on hold while the window is being moved.
pjw is correct in observing that the slaves regularly print characters incorrectly positioned in the master's window. I solved this problem
by clearing the receiving window every 2 seconds.

One other problem I struggled with was the fact that the new function PRTSTR% seems unable to print integer variables.
The function outputs an unprintable character if you try. I thus had to convert the integer into a floating point number.
PRTSTR% was designed to interpret integers (in the context of output symbols) as character codes so, yes, youd need to convert integers to strings or floats to circumvent that.
The job and channel menus show that all is working as I would have expected. (see screen print below) I am now going to see if I can do anything useful with these
two new functions.
Enjoy and Good luck!


Per
dont be happy. worry
- ?
Post Reply