> BTW: Has anyone tried to run my reflection toolkit with compiled code (IMHO NO chance with Turbo and most probably also not even with QLiberator).
I've not tried your toolkit, mostly because I don't care about line number with SuperBasic. I write all SuperBasic without line numbers and let my pre-processor do all of the dirty work. The code looks so much better with no line numbers. I can't imagine programming with C, Pascal, Perl, or awk with line numbers, so why do it with SuperBasic. (just my 2 cents).
Tim
Problem with parameter to a SuperBASIC machine code extension
- NormanDunbar
- Forum Moderator
- Posts: 2505
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: Problem with parameter to a SuperBASIC machine code extension
What Tim said! I haven't used line numbers in Super basic for ages!
Cheers,
Norm.
Cheers,
Norm.
Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Re: Problem with parameter to a SuperBASIC machine code extension
Good news:
Today I finished the "main" program of the missing function, and it seems to work.
Bad News:
I'm programming top (mostly very easy) down (mostly very complicated) and the 2 (assembler) subroutines, which do the real work, must still be written (they are currently only dummies, but at least they are called from the main program[!]).
Today I finished the "main" program of the missing function, and it seems to work.
Bad News:
I'm programming top (mostly very easy) down (mostly very complicated) and the 2 (assembler) subroutines, which do the real work, must still be written (they are currently only dummies, but at least they are called from the main program[!]).
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
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

Re: Problem with parameter to a SuperBASIC machine code extension
You MUST bother with line numbers, if you want to merge another S(uper)BASIC program to your main program, e.g. a library SuperBASIC program (which only contains PROCedures and FuNctions)!swensont wrote: Sat Aug 30, 2025 2:56 am I've not tried your toolkit, mostly because I don't care about line number with SuperBasic. ... line numbers, so why do it with SuperBasic. (just my 2 cents).
That's why I have started to write the Reflection Toolkit. With the REF_GETLNFREE%() S(uper)BASIC function and my "rn" (C) program it is now possible to merge ANY S(uper)BASIC program file which does not use GO TOs (SUBs, ...).
Now I'm trying (today I realized, that I most probably will succeed) to write a FuNction which allows to port programs which are using GO (TO/SUB/...).
Please note: Programs with GO... cannot be MERGEd directly, you first must port them. But this should be easy (if I will succeed).
Note 2: Ported programs using "my trick" will be slower than using GO... directly(!). Most often you won't notice it, but there may be programs (where a GO... is used in [deeply nested, often called] loops), which will be notably slower.
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
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

Re: Problem with parameter to a SuperBASIC machine code extension
> You MUST bother with line numbers, if you want to merge another S(uper)BASIC program to your main program
Not if all of your programs don't have any line numbers. If I want to use a procedure written by someone else, I will covert it to not have line numbers.
Also, I don't use MERGE, I use "#include file_ssb". This adds the file name "file_ssb" to the existing program as it is processed.
Tim
Not if all of your programs don't have any line numbers. If I want to use a procedure written by someone else, I will covert it to not have line numbers.
Also, I don't use MERGE, I use "#include file_ssb". This adds the file name "file_ssb" to the existing program as it is processed.
Tim
- NormanDunbar
- Forum Moderator
- Posts: 2505
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: Problem with parameter to a SuperBASIC machine code extension
Nope! If you use Tim's excellent (and I cannot praise it highly enough!) Structured SuperBASIC utility, you never need a line number again. Even for GO TO, GO SUB and RESTORE, no line numbers are required and the code still works.ql_freak wrote: Wed Sep 03, 2025 12:25 am You MUST bother with line numbers, if you want to merge another S(uper)BASIC program to your main program, e.g. a library SuperBASIC program (which only contains PROCedures and FuNctions)!
Merging other library functions? Simple, there's an "include" command which allows multiple depths of nested "includes" for as deep as you need to go, provided you don't run out of file channel in the channel table of course.
Tim gave his blessing to me to make some changes. These are based on Tim's version 2.7.2 --- available from https://github.com/SinclairQL/Structure ... /tag/2.7.2 and from Tim. Tim still uses that version as it does all he needs to do. I'm using 2.7.2g which is available from https://github.com/SinclairQL/Structure ... tag/2.7.2g.
I thoroughly recommend you give it a try.
Cheers,
Norm.
Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
-
- Font of All Knowledge
- Posts: 4853
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: Problem with parameter to a SuperBASIC machine code extension
Hi,
I try to never use GOTO, GOSUB and the RESTORE command is a nightmare.
I usually use SSB which when it first appeared was all I was looking for. so I use that by default now, which gave the use of labels instead of line number references.
If the Line Numbers could be not displayed in TK2 ED, would this encourage the use of Procedures and Functions rather that GOSUB and GOTO
I try to never use GOTO, GOSUB and the RESTORE command is a nightmare.
I usually use SSB which when it first appeared was all I was looking for. so I use that by default now, which gave the use of labels instead of line number references.
If the Line Numbers could be not displayed in TK2 ED, would this encourage the use of Procedures and Functions rather that GOSUB and GOTO
Regards, Derek