SuperBASIC omission (bug?) in SMSQ/E?

Anything QL Software or Programming Related.
User avatar
ql_freak
Gold Card
Posts: 354
Joined: Sun Jan 18, 2015 1:29 am

SuperBASIC omission (bug?) in SMSQ/E?

Post by ql_freak »

Minerva (AH, JM, JS, MG, ...):

Code: Select all

new
cls#2:list:REMark #2 is now cleared (empty window)
auto
100
delete the 100 and enter:

Code: Select all

load'WIN1_home_bas_testAuto_bat'
160 
delete the 160, press <ESC> and enter:

Code: Select all

list
result in #2:

Code: Select all

110 REMark AUTO test file
120 :
130 PRINT'First Line'
140 PRINT'Second Line'
The file 'WIN1_home_bas_testAuto_bat' has the following content:

Code: Select all

REMark AUTO test file
:
PRINT'First Line'
PRINT'Second Line'
How can I do that in SMSQ/E? AUTO just starts ED :-(


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: SuperBASIC omission (bug?) in SMSQ/E?

Post by swensont »

It sounds like you want to take a file with SuperBasic statements that don't have line numbers and add line numbers.

This (plus much more) can be done with Structured SuperBasic (SSB) a SuperBasic preprocessor I wrote some years ago. I can be found on Dilwyn's site:

http://www.dilwyn.me.uk/program/index.html

Either version (2.6.2 or 2.7) will work for you.

Tim Swenson


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

Re: SuperBASIC omission (bug?) in SMSQ/E?

Post by pjw »

Auto no longer works as it used to, as you have found out. ED has replaced the old line editor. However, auto line numbering still works in ED, so if you can find a way of stuffing S*BASIC lines into ED, the line numbers will increment as usual.
I wrote a small utility, StuffScrap, to transfer the SCRAP contents to a keyboard queue. If that queue happens to be ED, and there is a line number waiting for input, then a line-number-less code snippet can be entered into ED. My utility looks like this:

Code: Select all

10 REMark $$asmb=win1_tk_stf_STUFF_BIN,0,10
11 REMark $$chan=1
12 REMark $$stak=4096
13 :
14 EXT_PROC 'JVASGET'
15 :
16 IF MACHINE = 20: JVASGET
17 STUFF -5, SCRAP_GET$
18 QUIT
I compiled this and put it on the ALT v hotkey. (Its possible that my STUFF keyword could be replaced by TurboTK's TYPE_IN, and probably there are other suitable commands out there..)
This is just to demonstrate that there are workarounds for this issue, but they will probably involve some coding.
StuffScrap can be found at Dilwyn's. Its also useful to copy and paste code snippets (like the above) from your PC to QPC2 or SMSQmulator.


Per
dont be happy. worry
- ?
duncan
ROM Dongle
Posts: 49
Joined: Tue Aug 15, 2017 5:08 pm

Re: SuperBASIC omission (bug?) in SMSQ/E?

Post by duncan »

Alternatively there is the ClipScrapBoard package, CSB218.zip on Dilwyn's utilities download page. This contains PasteIt_obj that does the same with ED or other programs with a cursor. Same caveat - to paste in to ED an initial line number mus be given in ED. Just press enter after starting ED. PasteIt_obj should be put on a hotkey and when called will paste the contents of the SCRAP if it is text. PasteIt uses QUEUE% from the DIYToolkit.


User avatar
ql_freak
Gold Card
Posts: 354
Joined: Sun Jan 18, 2015 1:29 am

Re: SuperBASIC omission (bug?) in SMSQ/E?

Post by ql_freak »

Thanks a lot, all suggestions seems to be interesting !


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
johnh
ROM Dongle
Posts: 19
Joined: Mon Mar 28, 2011 10:12 pm
Location: South Wales

Re: SuperBASIC omission (bug?) in SMSQ/E?

Post by johnh »

Re. StuffScrap05.zip:

Having set up a hotkey as per the instructions, when I invoke StuffScrap (by pressing ALT+v), I get the following QLib error:

Job 16 ScrapStuff V1.03 STUFF
invalid name
Data : 512 0 0 Stack : 4096 392

The system is SMSQmulator V2.27 (SMSQ/E 3.34)

Also, LRESPR 'STUFF_BIN' (in Job 0) gives 'incomplete'.

Any suggestions?

John


johnh
ROM Dongle
Posts: 19
Joined: Mon Mar 28, 2011 10:12 pm
Location: South Wales

Re: SuperBASIC omission (bug?) in SMSQ/E?

Post by johnh »

Problem solved :-)

If I install the version of STUFF_BIN from Stuff02.zip (using LRESPR in Job 0), the hotkey works as advertised.

A more elegant/permanent solution would, of course, be to rebuild StuffScrap_obj to include the alternative STUFF_BIN...

John


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

Re: SuperBASIC omission (bug?) in SMSQ/E?

Post by pjw »

Hi johnh,
Yes, there seems to be a cockup here. Any errors should show "Job xx ScrapStuff V0.05..".
I'll update Knoware soon, but in the mean time try the attached version. There is no need to
LRESPR STUFF_bin to use ScrapStuff - unless you want to use STUFF for something else.

In case anyone else wants to try: This utility is for QPC2 and SMSQmulator only. It needs
JMS'es Qmenu for the Scrap Thing.

Warning! Unless you are very familiar with these systems, you many need to read the
instructions before use!

If you are using QLE, there may be a conflict with a similar utility in that distro. I havent
investigated this yet, so I dont know any more than that.

Here goes:
StuffScrap06.zip
(3.48 KiB) Downloaded 106 times


Per
dont be happy. worry
- ?
User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: SuperBASIC omission (bug?) in SMSQ/E?

Post by pjw »

Your wish just came true.. ;)


Per
dont be happy. worry
- ?
johnh
ROM Dongle
Posts: 19
Joined: Mon Mar 28, 2011 10:12 pm
Location: South Wales

Re: SuperBASIC omission (bug?) in SMSQ/E?

Post by johnh »

I'm afraid V0.06 gives the same error as V0.05 (apart from the job name, of course).

I must admit I didn't find this particularly surprising since I had noticed that the STUFF_BIN file in the archive (which is, presumably, the one used to create the OBJ file) hadn't changed.

As I said in my previous post, I think you need to update STUFF_BIN to the one from stuff02.zip...

John


Post Reply