SBASIC Programming

Anything QL Software or Programming Related.
Derek_Stewart
Font of All Knowledge
Posts: 4683
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: SBASIC Programming

Post by Derek_Stewart »

I use a Q68 in DISP_MODE 4 (1024x768) Mode 4.

Looks great on a 23" Monitor:
Q68_DISP_MODE4.jpg
Q68_DISP_MODE4.jpg (42.61 KiB) Viewed 1148 times


Regards,

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

Re: SBASIC Programming

Post by pjw »

Tinyfpga wrote: Mon Dec 30, 2024 10:06 am <>
The following picture shows QPC running SMSQE and Steem running SMS2.
QPC and SMS2.jpg
<>
Nice setup! (Shame about the colours ;))

I too had no problem with speed on my Atari MegaSTE back then. It was
ideally proportioned to the capabilities of the software. But then came
colour, which took its toll on the speed of hardware QLs, not so much on
emulators. But it wasnt about colours per se, but the new possibilities
high colour opened up, ie processing graphics and other "modern" file
formats. There was still then the hope that we might one day see a native
QL web browser etc, in which case both speed and resolution would need a
considerable bump.

That didnt happen and the complexity of modern browsers today makes it
unlikely that one or two guys sitting at home and toiling away for no pay
will be able to develop one. That ship has sailed.

Still, the QL and its OS were never intended to remain static. In the
nineties Microsoft spent a billion dollars on putting lipstick on the pig
we fondly remember as MSDOS and voilà! we have Windows 95! The rest is
history.. Had a fraction of that amount been spent of QL/Qdos things would
have looked very different today!

Anyway, I dont see why we shouldnt soldier on with what we have and make
the best future possible with what weve got. We wont have much of a future,
however, if people unnecessarily hold us back with poor programming
practices. A lot of effort was expended by the makers of Minerva, SMSQ/E
and the emulators to enable them to remain as much as possible backwardly
compatible with programs that break the rules. If we continue that way
we'll forever be stuck in that rut.


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
Tinyfpga
Gold Card
Posts: 304
Joined: Thu Sep 27, 2018 1:59 am

Re: SBASIC Programming

Post by Tinyfpga »

On the subject of Sbasic and Wmov, manuals, and colours.

Sbasic and Wmov
Dilwyn posted:-
"What the QL scene lacks is a good manual (for user interfaces and programming in Basic?)
What documentation exists is often fragmented into several places and light on good clear examples."

My system (I repeat myself) comes from the much simpler SMS2 environment which provides for an "Easy to use" method of compiling (with Qlib) Basic programs (see "Compiling a SuperBasic" thread). The high resolution system lends itself to creating a step by step development system by example.

As alluded to by pjw, the first thing programmers should learn is how place their program within a movable and escapable window. The screenshot below is a first step example. It demonstrates compiling the easy way, the use of Wmov to create a movable window and how on-screen help could be useful. The program can be "buttonised" with the Alt z hotkey mentioned earlier in this thread.
Wmov3.jpg
I have modified Dilwyn Jones's 24 years old MiniView program to be moveable, using Wmov, and have added margins to display the help text. (I find reading text that borders the edge of a window harder to read)

Using this system at a QL resolution of 512x256 is possible but not practical.
The Qimsi Gold solves this problem.
512x256.jpg
Manuals:-
The amount of knowledge required to be able to create my user interface and to just start to write a Basic program is considerable. The documentation needed to develop this knowledge is as, Dilwyn writes, fragmented. The considerable number of platforms on which SMS systems can run on, only adds to this fragmentation.
I learned most of what I know from the SMS2 manual and the original QL manuals. Writing a beginner's guide to writing Sbasic programs would be quite a task, but as an online start, I am impressed by pjw's example and would be willing to help. (Money maybe?)

To make matters even more difficult I find that for every line of code I write I make two or more errors. I make all sorts of errors such as:- Logical errors, typing errors, stuff that should work but doesn't, mathematical, data errors, etc,etc. A lot of the time I simply can't understand the manual even for the simplest instructions or concepts. How could one document these kind of problems? I think an interactive version of pjw's SMSQ/E Web could be a solution.

Sometimes an instruction simply does not do what I think it is supposed to do. eg. Wmov #1,-1.
What does "The smallest line which includes all actually open window ch" mean? (see pic)

Colours:-
Like speed, my view on the matter is that in an SMS system, high resolution beats high colour any day. If I want colour I use a PC. My favourite colours on a Q68, are, for example, B&W. The reason for this, as pjw has posted, is that it is not realistic to use SMS to mimic a mainstream computer. I find my austere interface pleasantly devoid of extravagant PC like abstractions. The significant presence of hotkeys, things, buttons and other hidden stuff is a reasonable substitute for colour.


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

Re: SBASIC Programming

Post by pjw »

RalfR wrote: Wed Dec 18, 2024 7:01 pm
pjw wrote: Wed Dec 18, 2024 6:48 pmWhat might have been nice is a sort of "standard window" in Qmenu - or a la Qmenu, which you could use as you please, but which had the basic functions of Move, Resize, Sleep,, Wake, etc. Just enough to knock up some simple programs with a minimum of fuss.
Oliver Fink has written such a program.....but for QPTR:

https://dilwyn.theqlforum.com/program/space.zip
I am aware of Oliver's SPACE project and just retested it now. Its a good
attempt (a bit long in the tooth now,) but to my mind Im not sure the
balance of simplicity over flexibility is entirely worth it. Might as well
go directly to Qptr.. After writing one or two simple programs oneself
one would have a flexible, reusable template of one's own.

Others have tried to achieve similar results by other means IIRC: George
Gwilt, Wolfgang Lenerz, others too, perhaps.. and while not in the same
league: yours truly.

JMS'es Qmenu is almost enough to knock up quick and simple programs in no
time. A main program window in the same style, with just a few parameters
would, in theory, be perfect. Perhaps that was tried, but that no simple
way of interacting with such a component was found.

I struggled for a long time to get to grips with PE programming so now that
Ive reached a certain level I might not be the best person to advise, as
Ive long forgotten the pain and struggle of getting there.

However, of all I tried, I found EasyPointer the simplest to get started
with: I worked my way through the manual. I looked at the sources of other
programs out there, then I built up a repertoire of my own templates, which
are easy enough to modify and reuse for all kinds of purposes.

Deeper, essential knowledge of PE can later be found in the Qptr manual. I
found that trying to read that manual did not make me wise, but once Id
acquired a little wisdom, I was able to understand what the manual
had described, with perfect clarity, from the start!


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
RalfR
QL Wafer Drive
Posts: 1179
Joined: Fri Jun 15, 2018 8:58 pm

Re: SBASIC Programming

Post by RalfR »

pjw wrote: Sun Jan 05, 2025 11:51 am...then I built up a repertoire of my own templates, which
are easy enough to modify and reuse for all kinds of purposes.
Would be nice, if you can share them :)

The problem with the secondaries still remains, which have to be located within the primary, which was not the case in the early days of PE. Small window = no QMenu File-Select.

You did something about it, but unfortunately your site is offline.


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

Re: SBASIC Programming

Post by pjw »

RalfR wrote: Sun Jan 05, 2025 11:55 am
pjw wrote: Sun Jan 05, 2025 11:51 am...then I built up a repertoire of my own templates, which
are easy enough to modify and reuse for all kinds of purposes.
Would be nice, if you can share them :)

The problem with the secondaries still remains, which have to be located within the primary, which was not the case in the early days of PE. Small window = no QMenu File-Select.

You did something about it, but unfortunately your site is offline.
But I did! Almost all my Knoware software comes with source code, including menus and any other objects. Most of the newer menus youll find there can be loaded into EasyMen and tweaked and altered to your heart's desire. Some of the older ones cant be, because before Marcel upgraded the EasyPointer suit it was necessary to patch them manually in ways EasyMen cant cope with.


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
pjw
QL Wafer Drive
Posts: 1608
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: SBASIC Programming

Post by pjw »

Oops! The text was updated from the email version, so I didnt see the added bit.


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
RalfR
QL Wafer Drive
Posts: 1179
Joined: Fri Jun 15, 2018 8:58 pm

Re: SBASIC Programming

Post by RalfR »

pjw wrote: Sun Jan 05, 2025 12:18 pmAlmost all my Knoware software comes with source code...
I know, but there is no "knoware.no" From where should I get it?

;)


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

Re: SBASIC Programming

Post by pjw »

RalfR wrote: Sun Jan 05, 2025 11:55 am <>
The problem with the secondaries still remains, which have to be located within the primary, which was not the case in the early days of PE. Small window = no QMenu File-Select.

You did something about it, but unfortunately your site is offline.
The rule that secondary windows must be within the primary window still holds, so if you want a program to display something outside of that, such as Qmenu's File Selector or my extended Popup texts (See POX) they have to be displayed by other jobs! Thats the trick! So you need to find a way of communicating with that external job. In the simplest case you need to know when it is terminated, and in more complex cases any kind of messaging between them.


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
pjw
QL Wafer Drive
Posts: 1608
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: SBASIC Programming

Post by pjw »

RalfR wrote: Sun Jan 05, 2025 12:23 pm
pjw wrote: Sun Jan 05, 2025 12:18 pmAlmost all my Knoware software comes with source code...
I know, but there is no "knoware.no" From where should I get it?

;)
I was offered a slot on this site many, many moons ago to revive Knoware.no, but despite repeated reminders, nothing seems to be happening..

Since knoware went offline, Ive added some 40 new titles and updates. I asked a few people to test a few of those before I let them loose on an unsuspecting public. One guinea pig gave me a sort of half-finished response; the others I have not heard back from at all, so my assumption must be that they dont give a shit about me nor my work.

But nice of you to enquire. If youd be willing to test some of my latest I could send you a link. Just DM me.


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
Post Reply