Page 16 of 42

Re: QL Tinkering

Posted: Wed Mar 31, 2021 9:23 pm
by mk79
qbits wrote:If you have written anything similar, I would be interested to see them or simply discuss alternatives as part of this topic!
TK2 comes with PRINT_USING

Code: Select all

PRINT_USING "###.###",1.23
Well with Easter almost upon us, I offer this the latest from my QL Tinkering’s… In continuation of my Coffee Cup Challenges, my QBITS Sliding Tiles and write up which includes QBITS Tic Tac Toe and a New Game QBITS Trader to test your resolve and skill as a Stock Market Trader.
Looks cool as always :-)

Cheers, Marcel

Re: QL Tinkering

Posted: Wed Mar 31, 2021 9:25 pm
by Cristian
qbits wrote:Well with Easter almost upon us, I offer this the latest from my QL Tinkering’s
Hi,
I've just made some quick tests with real QL and Qemulator. I've sent you some useful information via PM.

Re: QL Tinkering

Posted: Wed Mar 31, 2021 10:22 pm
by NormanDunbar
qbits wrote:If you have written anything similar, I would be interested to see them or simply discuss alternatives as part of this topic!
Many years ago, and I do mean many, I wrote a hard disc backup utility called WinBack. I used TK2 but when Dilwyn agreed to publish it, and as TK2 was commercial, I needed to write replacement code for any TK2 stuff I was using.

One of the functions I had to write was to enable me to format numbers into comma delimited, right justified format. I wrote it in assembly. I think I called it comma$, or similar. It was for unsigned values, no decimal points, and up to 13 digits. Leading zeros were suppressed, unless the number was itself zero.

I suspect, given its age, that the code may well be bad! (Winback_asm in this file http://www.dilwyn.me.uk/backup/wbsource.zip)

Cheers,
Norm.

Re: QL Tinkering

Posted: Thu Apr 01, 2021 9:40 am
by qbits
Thanks Marcel – PRINT_USING poses some interesting thoughts. I’ll have to see if I can work it with my specific set up.

Cristan - Thanks for reminding me the QBTTT and QBTile prog will need gx,gy line 1002 set to 0 for BBQL running.

Norman – Yes, back in the day I attempted to write some questionable assembly coded for right justify. Mine is lost in the past and rightly deserves to stay there….


QBITS

Re: QL Tinkering

Posted: Thu Apr 01, 2021 9:51 am
by vanpeebles
The trading game looks excellent!

Re: QL Tinkering

Posted: Thu Apr 01, 2021 11:17 am
by qbits
Thanks vanpeebles - the QBTrader_v2 posting is a beta version. I’m still in the process of playing around with variables to make the Market Simulation more diverse.

Cristian – running Q-emulator in limited features mode – I had a problem. The use of CURSOR#ch,x,y,x-offset,y-offset (the Graphics coordinates use of Cursor) doesn’t seem to be supported?

QBITS

Re: QL Tinkering

Posted: Thu Apr 01, 2021 11:57 am
by dilwyn
qbits wrote:Thanks vanpeebles - the QBTrader_v2 posting is a beta version. I’m still in the process of playing around with variables to make the Market Simulation more diverse.

Cristian – running Q-emulator in limited features mode – I had a problem. The use of CURSOR#ch,x,y,x-offset,y-offset (the Graphics coordinates use of Cursor) doesn’t seem to be supported?

QBITS
QBits - there is an article on the Articles page (where else?) on my site about the problem with a 5 parameter CURSOR command:
some versions of the QL ROM have a nasty bug which prevents the use of the five parameter version of the CURSOR command, but even on version AH and JM ROMs you can still get the command to work with 4 parameters, i.e. miss out the channel number, in which case it defaults to using channel #1. You can get more details of this bug by reading Simon Goodwin and Mark Knight's articles on QL bugs in past issues of QL World and QL Today respectively
To work around this you may be able to fiddle around with channel IDs, there was an article by Simon Goodwin about the equivalent of an USE command, which allowed other channels to be assigned as default channel instead of #1, maybe QL World, maybe DIY Toolkit, I can't find it atm.

EDIT: The article was published in QL World March 1988. The code and text of the article is available in DIY Toolkit Volume C (the USE extension) - http://www.dilwyn.me.uk/tk/diytk2.zip

Re: QL Tinkering

Posted: Thu Apr 01, 2021 7:34 pm
by qbits
Dilwyn – I checked out USE and it would be of great use, no pun intended.
It could replace my ch=n S/SuperBASIC Command #ch, that I use for the same reason the Command USE was intended.
I wonder why it wasn’t included in the QPC keywords! Or is there an alternative?

QBITS

Re: QL Tinkering

Posted: Fri Apr 02, 2021 8:41 am
by qbits
You learn something new every day. The CURSOR graphics coordinates for the original SuperBASIC I have learnt, been reminded only applied to the default Window Channel #1 and only accepted 4 parameters x, y Graphics coordinates with x ,y Pixel offsets. The channel option was added I guess with TK2. QBTiles_v2BBQL should now run OK.

QBITS

Re: QL Tinkering

Posted: Fri Apr 02, 2021 1:03 pm
by tofro
qbits wrote:... The channel option was added I guess with TK2. QBTiles_v2BBQL should now run OK.

QBITS
I don't think so. JS and onwards had the optional channel number in CURSOR.