EDSPR under QPC2 doesn't work

Anything QL Software or Programming Related.
Ralf R.
Over Heated PSU
Posts: 131
Joined: Fri Jun 15, 2018 8:58 pm

EDSPR under QPC2 doesn't work

Postby Ralf R. » Tue Jun 04, 2019 6:06 am

Does anyone tried to run QPTR's EDSPR successfully under QPC2? I have tried it (as SBASIC), but beside the pointer loop nothing happens. Selecting anything (the grid, functions, files) makes no action.

Beside the COMPILED in line 100 I have changed nothing.

Any ideas?


User avatar
Artificer
Chuggy Microdrive
Posts: 62
Joined: Fri Nov 24, 2017 8:43 am

Re: EDSPR under QPC2 doesn't work

Postby Artificer » Tue Jun 04, 2019 7:03 am

Hi,

Did you leave the lines mnch=0:pdch=1 :CLOSE#1,2
OPEN#mnch;con_2x1a0x26: INK#mnch;0

They are essential for the init procedure to outline the primary window mnch(#0) as it is the channel the pointer is read in.

Cheers


Ralf R.
Over Heated PSU
Posts: 131
Joined: Fri Jun 15, 2018 8:58 pm

Re: EDSPR under QPC2 doesn't work

Postby Ralf R. » Tue Jun 04, 2019 7:51 am

As I said, I have just changed "COMPILED" in line 100, (as it is now a SMSQ/E function) into "compile", nothing else.

Beside this, a REMark in the first line says, it is v0.02.


User avatar
Artificer
Chuggy Microdrive
Posts: 62
Joined: Fri Nov 24, 2017 8:43 am

Re: EDSPR under QPC2 doesn't work

Postby Artificer » Tue Jun 04, 2019 8:11 am

Hi,
mnch needs to be opened as #0 otherwise the outline won't be set correctly. The code seems to set mnch to be 5 or 6 if run as is. The whole if compiled clause needs to be changed to give the code above.
Cheers


Ralf R.
Over Heated PSU
Posts: 131
Joined: Fri Jun 15, 2018 8:58 pm

Re: EDSPR under QPC2 doesn't work

Postby Ralf R. » Tue Jun 04, 2019 8:14 am

Ah, ok, thanks, I will try this.


Ralf R.
Over Heated PSU
Posts: 131
Joined: Fri Jun 15, 2018 8:58 pm

Re: EDSPR under QPC2 doesn't work

Postby Ralf R. » Tue Jun 04, 2019 8:55 am

Artificer wrote:mnch needs to be opened as #0 otherwise the outline won't be set correctly. The code seems to set mnch to be 5 or 6 if run as is. The whole if compiled clause needs to be changed to give the code above.


Hmm, makes me wonder, as I have tried the test program of the QPTR manual for RPTR just to get the pointer coordinates back, and that worked with #3. But it did not work with QPTR's OUTLN instead with OUTL from Marcel's Demo WIN. Whatever the differences may be.

QPTR overwrites QPC2'S OUTLN, from weherever OUTL comes from. But that worked.


Derek_Stewart
QL Wafer Drive
Posts: 1410
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: EDSPR under QPC2 doesn't work

Postby Derek_Stewart » Tue Jun 04, 2019 9:30 am

Hi,

I tried compiling EDSPR_bas with Qliberator, on SMSQmulator, with QPTR toolkit v0.14.

I had to change Lines 100 and 105 which had a keyword clash with the Turbo Toolkit COMPILED function, to COMPILE in each line.

Qliberator compiled the programmed OK and the object code was executed as expected.


Regards,

Derek
Ralf R.
Over Heated PSU
Posts: 131
Joined: Fri Jun 15, 2018 8:58 pm

Re: EDSPR under QPC2 doesn't work

Postby Ralf R. » Tue Jun 04, 2019 10:16 am

Ah, that's where COMPILED comes from (I should have known this...). Unfortunately, a lot of programs used this as a variable (incl. TT), maybe, because once it was written in the QLib manuals demo programs.


Ralf R.
Over Heated PSU
Posts: 131
Joined: Fri Jun 15, 2018 8:58 pm

Re: EDSPR under QPC2 doesn't work

Postby Ralf R. » Tue Jun 04, 2019 4:30 pm

No luck at all. it still doesn't run in Basic (same as before) and compiled it give Qlib error "Unknown Channel ID". Perhaps someone can put his working SBASIC version here.

Edit1: For test purposes, I have tried a clean QPC2 with just QPTR loaded. Same result in SBASIC. Pointer runs, but nothing else.

Edit2: Ok, next test, recent version of SMSQmulator (also clean started with just QPTR). Here it works, very mysterious.... So there must be something with QPC2, which I do not know.

Any ideas?


Derek_Stewart
QL Wafer Drive
Posts: 1410
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: EDSPR under QPC2 doesn't work

Postby Derek_Stewart » Wed Jun 05, 2019 10:08 am

Hi Ralf,

I had a look at 'edspr_bas', I could compile and run the Qliberator object file, but executing a SBASIC job failed or running from SBASCI job 0 failed.

So I looked at the source code, looks a little bit of a mess, the programme has been written to use I/O channels explicitly defined, that is channels 5,6.

So I replaced the open channel statements with FOPEN channel statement, to use the next available channel number. Just is case channel number used in the original 'edspr_bas' were taken. This affect channels: mnch, gpch and pdch. Note pdch is defined with an open statement in PROCedure pulld.

I removed the COMPILED select statement, as I think programmes should open their own channels.

Attached is the amended source code to 'edspr_bas', I usually put the version number after the programme name and before the _bas suffix. Not, the file is zipped, because the QL FOrum Attachment software gives an error to the _bas and .bas extensions.

I have test this in SMSQmulator, QPC2, Q68, UQLX with Qlib compiled and Multibasic.

It seems running from QD using the QS/BAS Thing, needs an extra OUTLN statement for channel #0, but I think O do not understand the OUTLN command, so back to the reading the manuals.
Attachments
edspr01.zip
Update to QPTR EDSPR_BAS
(6.56 KiB) Downloaded 22 times


Regards,

Derek

Who is online

Users browsing this forum: No registered users and 6 guests