SBASIC Programming

Anything QL Software or Programming Related.
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 »

Why not just use WMON ,x, y instead of all those lines of code?


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
ql_freak
Gold Card
Posts: 487
Joined: Sun Jan 18, 2015 1:29 am

Re: SBASIC Programming

Post by ql_freak »

pjw wrote: Wed Dec 25, 2024 11:36 pm Why not just use WMON ,x, y instead of all those lines of code?
Sorry can't remember, why I wrote this. BUT: I remember there was a problem (don't know what). BTW: Is it possible with WMON to set the top left corner of the screen (was not possible on a BBQL and TK2, as it has had only 512x256).

Edit: Found it :-)

With WMON x,y the colors (and eventually borders) of the windows are not set. This can look horrible.


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 :-)
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 »

ql_freak wrote: Thu Dec 26, 2024 1:46 am <> BTW: Is it possible with WMON to set the top left corner of the screen (was not possible on a BBQL and TK2, as it has had only 512x256). <>
Im not sure what you mean..
Edit: Found it :-)

With WMON x,y the colors (and eventually borders) of the windows are not set. This can look horrible.
When programs, like the recent Christmas tree one, messes up my screen (my
gripe with that kind of programming is one of the purposes of this thread)
then I come prepared with a hotkey ALT+B, defined in my boot sequence:

Code: Select all

ERT HOT_KEY('B', "CLOSE:PAPER#0;0:INK#0;4:PAPER 2:INK
7:PAPER#2;7:INK#2;2:WMON ,512,0:CLS#0:CLS:CLS#2" & CHR$(10))
That normally cleans up the mess.

Note this code is all on one line! It presumes TK2+EE or SMSQ/E. (EE =
Extended Environment = PE + hotkey system.)

However, I wouldnt normally expose my system console to the vagaries of
incidental programs I try out. Us lucky SMSQ/E users have the luxury of
daughter SBASICS. So I have another set of hotkeys to start up an SBASIC of
512x256a0x0, which is used for such cases. Thus, when the rogue program has
run its course, I just type QUIT:

Code: Select all

ERT HOT_THING(CHR$(236), 'SBASIC'): REMark F2 = New SBasic
ERT HOT_PICK(CHR$(238), 'SBASIC'):  REMark Shift+F2 = Pick SBasic
Because I use Qpac2's excellent Button Frame, I prefer my system console
not to cover it, therefore my system console is defined by, and restored
with, the following hotkey command (again: all one line!):

Code: Select all

ERT HOT_KEY('b',
"OUTLN#0,512,242,SCR_XLIM-512,14:WINDOW#0;512,62,SCR_XLIM-512,194:BORDER#0-
;1,255:WINDOW#1;256,178,SCR_XLIM-256,14:BORDER#1;1,255:WINDOW#2,256,178,SC-
R_XLIM-512,14:BORDER#2;1,255:CLS#0:CLS#1:CLS#2" & CHR$(10))
Ie the window is slightly smaller (so I cant just use WMON) and is placed
on the RHS below the button frame. I could probably have made this more
compact and elegant. However, like so many of us, I wrote this a long time
ago, under different conditions, and have forgotten the reasons for the
decisions made at the time.

There may well be better ways of doings things, also there is the question
of taste.. I dont use any BASIC consoles for programming, except perhaps to
try out some expression or function, so the slightly smaller window is no
loss.

Anyone loading EasyPointer's toolkit ptrmen_cde has access to the command
WMOV. Type that in any SBASIC window to move the window anywhere on screen.
WMOV can be used in BASIC programs too, no need to go full PE to use it,
just call it as any other program function.

For those not yet familiar with SMSQ/E or the Extended Environment there
are two other hot things I find quite handy:

Code: Select all

ERT HOT_THING('z', 'Button_Sleep')
Place the pointer in any program window and press the hotkey, and the
program is "put to sleep", or buttonised. Works with any type of program!
Useful to find buried windows or just clear away some clutter.

The other is:

Code: Select all

ERT HOT_THING('=', 'Button_Pick')
This picks the Button Frame so all those sleeping programs are brought to
the top like a menu.

I dont know who invented this kind of functionality. I cant remember
anything half as useful in Windows back in the day, let alone Linux. Mac,
perhaps? From the little Ive gleaned of other people's setups, It doesnt
seem to have arrived on a lot of QL desktops yet either..

Merry Christmas!


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
tofro
Font of All Knowledge
Posts: 3093
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: SBASIC Programming

Post by tofro »

pjw wrote: Thu Dec 26, 2024 12:26 pm
I dont know who invented this kind of functionality. I cant remember
anything half as useful in Windows back in the day, let alone Linux. Mac,
perhaps? From the little Ive gleaned of other people's setups, It doesnt
seem to have arrived on a lot of QL desktops yet either..

Merry Christmas!
Agree - in most setups I've seen, the potential of the Hotkey System is just about scratched, if at all (and I would absolutely not claim that my own one couldn't be improved a lot). You can make your QL life so much easier with a few hotkeys.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
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 »

Sorry, I messed up the first code snippet as I had tried to edit it to a comply with a more standard usage than I expect my own is. It should be (or could be):

Code: Select all

ERT HOT_KEY('B', "CLOSE:PAPER#0;0:INK#0;4:PAPER 2:INK 7:PAPER#2;7:INK#2;2:WMON 4:CLS#0:CLS:CLS#2" & CHR$(10))
Lesson (re)learned: However small the change, always test any code after editing before posting! <slaps wrist> (<Ouch!>)


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 »

tofro wrote: Thu Dec 26, 2024 2:49 pm <>
Agree - in most setups I've seen, the potential of the Hotkey System is just about scratched, if at all (and I would absolutely not claim that my own one couldn't be improved a lot). You can make your QL life so much easier with a few hotkeys.
Im glad you agree! I wonder how many others do. Perhaps many are just mystified, or think it too complicated, or are too uncurious to even try, or have tried but simply dont like it.. Or maybe they know something far superior that we've never even heard of or are too dumb to understand..


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
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 »

Hi,

Most of the HOTKEY definitions to suspend running tasks, select the ButtonFrame, as detailed in the QPAC2, QPTR manuals.

The example boot files supplied with QPAC2, detail a lot of the use of Hotkeys and Buttons.

The Extended Environment (EE) is a very misunderstood environment, often compared to Windows and other GUI systems, which is a totally different systems. There is some critricism of EE, of how bad if looks in relation to something GEM or Workbench. But how many Amiga experts actually understand Institution...

I would rather have EE than the other GUI systems that need Megabytes of memory and disk space, where as 640Kb ram gives a reasonable good GUI based system, that is easy to understand.
Last edited by Derek_Stewart on Fri Dec 27, 2024 6:58 am, edited 1 time in total.


Regards,

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

Re: SBASIC Programming

Post by XorA »

But how many Amiga experts actually understand Institution
No idea what that is, but Intuition was really easy. But I think you are talking on different levels, Intuition is widget based, as far as I can see the PE is more like X11 and window based!


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 »

XorA wrote: Thu Dec 26, 2024 6:48 pm
But how many Amiga experts actually understand Institution
No idea what that is, but Intuition was really easy. But I think you are talking on different levels, Intuition is widget based, as far as I can see the PE is more like X11 and window based!
yes sorry, there is widget based system on the QL, I mean QPAC2, ProWesS is not the same thing.


Regards,

Derek
User avatar
dilwyn
Mr QL
Posts: 3064
Joined: Wed Dec 01, 2010 10:39 pm

Re: SBASIC Programming

Post by dilwyn »

What the QL scene lacks is a good manual for those new to anything other than the most basic BBQL.

And there are plenty of new users from the retro community in general now, not to mention returnees to the scene.

What documentation exists is often fragmented into several places and light on good clear examples. As one of the most prominent QL websites, mine generates the same old questions all the time despite all the answers (or the vast majority) already being on my site or the Forum. There are times when I could kill that "Contact Me" message form. Most of tonight went answering the build-up of messages which came in from about mid December to now which I didn't feel up to answering while I was ill.

We have so many varieties of QL expansions, QL-compatibles and emulations (not to mention filing systems) it tends to be harder now for people to understand anything other than the system in front of them. Personally, I'm amazed that so many people use MDV-based systems, not just QL microdrives but MDV emulations, be they emulators or SD card systems, not to mention ancient systems like ICE.

It really needs someone to write a "QL Manual Version 2" covering the diverse directions QL systems can go in these days. Quick list :
  • Toolkit 2
    Other system extensions
    Adding memory and QL cards.
    Pointer Environment (not many seem to know the difference between pointer environment and extended environment for example)
    QDOS and SMSQ/E differences
    Getting going with SMSQ/E
    Basic differences between the various QL systems - which can do what.
    Filing systems used by QLs, Qubides, compatibles, emulators, etc.
    Downloading, unzipping, file transfer, serial links
    Networking, including use of Martin's software on capable hardware.
    Sources of advanced information - the QPTR and SMSQ Ref guides, etc
Perhaps we should start by generating a proposed "contents list" for any QL manual V2, then it stands a chance of being written. Especially if we can get more than one persons to tackle parts they are familiar with.

It'll probably end up being at least the size of the SuperBasic Reference Manual!

As ever, the problem is TIME. I've not written much QL software at all this year simply because I've been so busy. Despite being early-retired (my formal retirement is end of next year) I seem to have less time on my hands than I ever did :cry: .


Post Reply