Curve smoothing

Anything QL Software or Programming Related.
User avatar
Andrew
QL Wafer Drive
Posts: 1031
Joined: Tue Jul 17, 2018 9:10 pm

Re: Curve smoothing

Post by Andrew »

dilwyn wrote: Mon Oct 14, 2024 10:14 pm Running it on QPC2 I get the error

At line 1310:3 assignment can only be to a variable or array element

That statement is qx = xc-xd, the only thing I can think of is that QX is a clashing command name in a QLiberator toolkit extension?

Certainly, if I run t on a "clean" QPC2 (i.e. no extensions loaded), it works OK.
I get a similar error for variable PW - it conflicts with a name from ProWes. I renamed it to PWW.
I think it's impossible to prevent all clashing situations.


stevepoole
Aurora
Posts: 886
Joined: Mon Nov 24, 2014 2:03 pm

Re: Curve smoothing

Post by stevepoole »

Thanks Andrew, problem noted and corrected ready for the next version. Steve.

____________________


User avatar
dilwyn
Mr QL
Posts: 3050
Joined: Wed Dec 01, 2010 10:39 pm

Re: Curve smoothing

Post by dilwyn »

I agree with Andrew that short of looking up names in a gigantic list of names used as keyword names (and there is such a list on my site) it's probably impossible to avoid sometimes.

I'd arrived home later than I expected last night after attending a meeting, and was a bit too tired to start debugging. I was glad that Steve confirmed what I said and even went as far as saying which lines needed to be changed.

A utility like the QFIND function in the QREF utilities is so useful when amending things like this. I use it all the time - find the first instance of the variable to rename with ED QFIND('name_to_change') , amend that name by hand, and ED QFIND repeatedly to find all other instances.


User avatar
Cristian
QL Wafer Drive
Posts: 1024
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Curve smoothing

Post by Cristian »

stevepoole wrote: Mon Oct 14, 2024 9:26 pm Hi Cristian,

This error may be a name-table problem. What system are you using ?

The program has run for a week under QPC2, with randomised data, tested ok... Steve.
__________________
128K QL, JS ROM, Toolkit2 (Qemulator)


stevepoole
Aurora
Posts: 886
Joined: Mon Nov 24, 2014 2:03 pm

Re: Curve smoothing

Post by stevepoole »

Hi Cristian,

Insert the line 685 ax=t(a,x): ay=t(a,y) which should cure that particular problem.

However on my SGC, under QDOS, there is a problem with an ASIN(ry/h) overflowing.

A fixed QDOS version will follow soon.... Steve.

_______________________________________


User avatar
Cristian
QL Wafer Drive
Posts: 1024
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Curve smoothing

Post by Cristian »

Thank you Steve, now it works!


stevepoole
Aurora
Posts: 886
Joined: Mon Nov 24, 2014 2:03 pm

Re: Curve smoothing

Post by stevepoole »

Hi QDOS Users,
Here is ContourDemo3_bas, which has been tested OK under QDOS, on my SGC, for 24 hours with random data.

I had to include line 2000, to avoid a QDOS ASIN(1) bug that halted the program, if '1.00000001' occured as entry parameter.

( This bug never occurred under SMSQ/E, neither with QPC, nor with SGC ). The cause was my fudge to avoid divisions by zero !

I hope to improve the graphics output still further, as three points on a straight line have infinite curvature, and are fudged too...

Just UNZIP & LRUN. Please report any other quirks you may detect.... Regards, Steve.
ContourDemo3.zip
(4.55 KiB) Downloaded 122 times


mhanias
Brittle Membrane
Posts: 113
Joined: Mon Jul 11, 2011 10:12 pm

Re: Curve smoothing

Post by mhanias »

I wonder if the plots can be transferred to Easel.


stevepoole
Aurora
Posts: 886
Joined: Mon Nov 24, 2014 2:03 pm

Re: Curve smoothing

Post by stevepoole »

Hi Mhanias,

The QL user guide, 'QL Information' section, page 6/84 contains information about Import/Export of data to the Psion suite (excel etc).

It is possible to export Psion data to Superbasic programs, providing row and column headings etc are catered for, (see the Psion format).

A suitable procedure for importing excel data to the Curve-smoothing program is perfectly realisable....

But it does not allow Excel to include Superbasic programs,, written using the interpreter. (The 'curve' program is quite lengthy).

I hope this helps ? Regards, Steve.


Tinyfpga
Gold Card
Posts: 304
Joined: Thu Sep 27, 2018 1:59 am

Re: Curve smoothing

Post by Tinyfpga »

Just UNZIP & LRUN. Please report any other quirks you may detect.... Regards, Steve.
From my perspective it is quite quirky, but that is because I use SMSQE at high resolutions and thus need programs that are moveable within its extended environment.
The program LRUNs on my SMSQE setup, but does not execute as an SBASIC job. It will not compile using QLiberator with or without line numbers.
I like the program and felt it was worth modifying it to be moveable and compilable without line numbers. The most difficult bit (for me) was eliminating the program's GOTOs. The result was a compiled moveable program that might be used to create animated wire frame images, if only I could understand how it works. As you say "the program is quite lengthy".
The really quirky thing ,now, is that with GOTO's eliminate the code cannot be interpreted but works perfectly when compiled. If interpreted it fails with the error:- "At line 2160:1 Return not in procedure or function"
I post a container file with copies of the modified code for the Contour program with and without dots. I tried to modify the original as little as possible.
contour 6.jpg
contour 7.jpg
Win3.zip
(473.42 KiB) Downloaded 90 times


Post Reply