EDSPR under QPC2 doesn't work

Anything QL Software or Programming Related.
User avatar
RalfR
Aurora
Posts: 872
Joined: Fri Jun 15, 2018 8:58 pm

EDSPR under QPC2 doesn't work

Post by RalfR »

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?


4E75 7000
User avatar
Artificer
Over Heated PSU
Posts: 126
Joined: Fri Nov 24, 2017 8:43 am

Re: EDSPR under QPC2 doesn't work

Post by Artificer »

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


User avatar
RalfR
Aurora
Posts: 872
Joined: Fri Jun 15, 2018 8:58 pm

Re: EDSPR under QPC2 doesn't work

Post by RalfR »

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.


4E75 7000
User avatar
Artificer
Over Heated PSU
Posts: 126
Joined: Fri Nov 24, 2017 8:43 am

Re: EDSPR under QPC2 doesn't work

Post by Artificer »

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


User avatar
RalfR
Aurora
Posts: 872
Joined: Fri Jun 15, 2018 8:58 pm

Re: EDSPR under QPC2 doesn't work

Post by RalfR »

Ah, ok, thanks, I will try this.


4E75 7000
User avatar
RalfR
Aurora
Posts: 872
Joined: Fri Jun 15, 2018 8:58 pm

Re: EDSPR under QPC2 doesn't work

Post by RalfR »

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.


4E75 7000
Derek_Stewart
Font of All Knowledge
Posts: 3957
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: EDSPR under QPC2 doesn't work

Post by Derek_Stewart »

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
User avatar
RalfR
Aurora
Posts: 872
Joined: Fri Jun 15, 2018 8:58 pm

Re: EDSPR under QPC2 doesn't work

Post by RalfR »

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.


4E75 7000
User avatar
RalfR
Aurora
Posts: 872
Joined: Fri Jun 15, 2018 8:58 pm

Re: EDSPR under QPC2 doesn't work

Post by RalfR »

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?


4E75 7000
Derek_Stewart
Font of All Knowledge
Posts: 3957
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: EDSPR under QPC2 doesn't work

Post by Derek_Stewart »

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 117 times


Regards,

Derek
Post Reply