I'm looking for a S*BASIC app, possibly by Tim Swenson!

Anything QL Software or Programming Related.
User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: I'm looking for a S*BASIC app, possibly by Tim Swenson!

Post by NormanDunbar »

NormanDunbar wrote:...I've fancied giving that a go for some time now, and now that I'm in the middle of writing something in S*BASIC, I though I'd give it a try.
Ok, I've spent the afternoon with SSB and I really wish I'd used it before. This is great!

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.
User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: I'm looking for a S*BASIC app, possibly by Tim Swenson!

Post by dilwyn »

Andrew wrote:
dilwyn wrote:Interestingly, the search box on my site fails to find that one, in my phone at least. Will investigate when I get home.
The search on your site does not indexes the real file names nor the full path links, only the link description (the alt text).
The alt text for http://www.dilwyn.me.uk/tk/env.zip is Environment Variables v1.07 and that is indexed
Have worked around this by adding ENV_bin to the textual description and told it to re-crawl the site. When that's done, the search box should now pick up the text to help people like Norman to find it. Better late than never.

Actually, looking at the search system used, it's gained some new options since I last checked in. So I've added an extra search option, "The Web" now. If that works, I can probably get rid of the Google Custom Search Engine part which slows the main page down quite a bit.


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

Re: I'm looking for a S*BASIC app, possibly by Tim Swenson!

Post by Derek_Stewart »

Hi,

SSB first appeared in 1997, Tim, wrote about it in the QL Hackers Journal vol1, you can get the QLHJ from his web site:
http://swensont.epizy.com

Also checkout SMSQZINE Vol8

Environmental Variables extension, ENV.BIN is included in the C68 package.

I have used Environmental Variables since 1990s, thought everyone used them...


Regards,

Derek
Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: I'm looking for a S*BASIC app, possibly by Tim Swenson!

Post by Derek_Stewart »

Hi,

Just another thought, why not use QD to write the SBASIC programme, so that line numbers are not required.

To run the programme, configure QD to use QD/SBAS to call SBASIC interpreter, by pressing F10

Also, if you have the Help system setup, pressing F1 on the keyboard will load the definition of the keyword.

I have converted section 7 of Superbasic Manual to QD Help format, which works quite well except for the formatting from the manual.


Regards,

Derek
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: I'm looking for a S*BASIC app, possibly by Tim Swenson!

Post by swensont »

I wondered why my ears were burning earlier this morning.

Norman, if you have any questions on SSB, feel free to reach out to me.

Tim


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: I'm looking for a S*BASIC app, possibly by Tim Swenson!

Post by NormanDunbar »

Hi Tim,
swensont wrote:I wondered why my ears were burning earlier this morning.
Norman, if you have any questions on SSB, feel free to reach out to me.
Tim
First of all, thanks for SSB, what an excellent program. I'm typing in VSCode on Linux, and SSB runs to pick up the source and write the S*Basic back to Linux from where, S*BASIC loads it and runs it. I can move functions and procedures around will-nilly and not have to worry about renumbering. It's so much easier! I love it and will be using it from now on whenever I need to do S*BASIC code. I wish I'd used this application years ago!

However, I have possibly broken it! Given this test file:

Code: Select all

Define Procedure test
    x = 1: ** Just  a variable named x.
    
    ** Indented comment.
End define test
The generated BASIC code is:

Code: Select all

1000 Define Procedure test
1010     x = 1: ** Just  a variable named x.
1020 REMark    Indented comment.
1030 End define test

The first remark, after the "x" variable is not translated from "**" to "REMark".

The indented comment's "REMark" is not indented correctly to match the rest of the procedure. The indentation seems to come after the "REMark" keyword.



If you don't mind, I have a couple of nice to haves:

Where we are allowed to use blank lines in the SSB file, It would be rather nice to have those translated to a correctly indented line consisting of a line number and a colon. I used this quite often in my S*BASIC code to split things up neatly. For the same example SSB file above, I would hopefully see:

Code: Select all

1000 Define Procedure test
1010     x = 1:  REMark Just  a variable named x.
1020     :
1030     REMark Indented comment.
1040 End define test
I use the command line to run SSB. This lets me pass the input file and starting line number. If the output file already exists, it appears to delete it, and exit. A subsequent execution will generate quite happily not that the output file is gone. Is it possible to have the output file deleted if it exists, and the generation proceed as normal? The file is gone whatever happens! Maybe an additional Y/N parameter on the command line to indicate that the file should be deleted or not? If not given, or if "N" then the run should exit if the file exists, without deleting it.

Thanks.

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.
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: I'm looking for a S*BASIC app, possibly by Tim Swenson!

Post by swensont »

Norman,

Comments are only allowed as the first statement in a line (similar to shell scripting). So you line:

x = 1: ** Just a variable named x.

I not allowed in SSB and the ** is not the first two characters of the line.

As for the line:

1020 REMark Indented comment.

You are right in that REMARK is not indented. That could be fixed.

As for translating a blank line into a line number and a colon, that is a technique that I never learned to use so I did not think about it. My personal feeling is that the colon looks a bit ugly and is a convoluted way to get a blank line. The idea is to have the original SSB code look good for reading and not worry to much about what the _BAS code looks like.

Tim


User avatar
XorA
Site Admin
Posts: 1358
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: I'm looking for a S*BASIC app, possibly by Tim Swenson!

Post by XorA »

Comments are only allowed as the first statement in a line (similar to shell scripting). So you line:
Pretty much all shells I use the comment must be the LAST thing on the line (it does not matter that it is also the first).


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: I'm looking for a S*BASIC app, possibly by Tim Swenson!

Post by NormanDunbar »

swensont wrote:As for translating a blank line into a line number and a colon, that is a technique that I never learned to use so I did not think about it. My personal feeling is that the colon looks a bit ugly and is a convoluted way to get a blank line. The idea is to have the original SSB code look good for reading and not worry to much about what the _BAS code looks like.
Ok, no worries. I might have a look at the 2.7.2 sources and see if I can add this in, perhaps as an option.

I've been using the colon to get separation in my sources for decades! It's so much neater than a blank "REMark" line. I use a pair of colon lines between procedures, funtions etc. Makes listing pretty neat, I think.

Thanks again for SSB, I really wish I'd started using it years ago!

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.
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: I'm looking for a S*BASIC app, possibly by Tim Swenson!

Post by swensont »

Norman,

The ** will create a REMark statement. The other comment is ## which does not show up in the final BASIC program. This is what I use. The full code with comments ends with _SSB. When I convert to _BAS, I leave out the comments. I don't see them as needed as no one should be reading the _BAS but the _SSB. Sort of like not caring how a _ASM file looks after it comes out of a C compiler. As long as the assembler likes it, it's good.

Tim


Post Reply