Page 1 of 1

Minerva: How to start MultiBASIC with a program which needs a CON-channel #0

Posted: Wed Mar 26, 2025 8:41 pm
by ql_freak
 
I have tried:

Code: Select all

ex'pipep';'sbprog_bas>'
First this worked perfectly (about 5 to 10 times), but suddenly it does not work anymore. The SuperBASIC manual states, that it is not possible for a Multi-BASIC program to open a CON channel #0 if the ">" CMD$ syntax is used, because this would close the channel to "sbprog_bas" from which the program is read.

In SMSQ/Es SBASIC it should be easy, you simply could use:

Code: Select all

ex'sbprog_bas'

Re: Minerva: How to start MultiBASIC with a program which needs a CON-channel #0

Posted: Wed Mar 26, 2025 9:04 pm
by Derek_Stewart
Hi,

I use the pipep method to start all Minerva Multibasic programs, the only thing is that the program running in multibasic, have to open their own channels. So I never opened channel #0 in multibasic. Any errors go to a dedicated channel.

In fact back in the good olde days, I used to run a BBS, using a QL with Minerva. The BBS software was executed from Multibasic, leaving Superbasic alone.

The difference with SMSQ/E SBASIC, is that the multitasking interpreter defines its own channel #0,#1,#2, this seems to more defined than Minerva Multibasic.

But if you use QD and SBAS Thing, this opens a single window with only channel #0,#1 open like Multibasic.

Re: Minerva: How to start MultiBASIC with a program which needs a CON-channel #0

Posted: Fri Mar 28, 2025 9:56 pm
by ql_freak
I think (not 100% sure, that it will work forever) I have now found a solution (albeit ugly), how I can start a MultiBASIC job, which can have a Console channel #0:

Code: Select all

ex'pipep','CON','CON';'PTH1_myprog_bas>'
In this case 2 CON channels (#0 and #1) are opened and the program PTH1_myprog_bas will be loaded and run (LRUNed). It seems, it's then even possible to reopen #0 in the program with e.g. open#0,'CON_512x256a0x0'.

EDIT: It seems it's also working with just one 'CON' (Tested on sQLux 1.1.1, Windows 10, english Minerva, German keyboard). Try this:

Code: Select all

ex'pipep','con';'multibas_sbt>'
Source "multibas_sbt" (sbt: S[uper]BASIC Template) – UNDER CONSTRUCTION(!) – variable (i with accend degue) in 103 is wrong because of encoding QL->UTF-8:

Code: Select all

103 “$=CHR$(10):  REMark “$ is the LINEFEED charachter!
104 REMark On sQLux with english Minerva '“' is on a German keyboard: CTRL+3
110 :
120 REMark local :REMark Reserved (until 149) for local variables in main program
149 :
150 _DESCRIPTION_$='SuperBASIC/SBASIC Template for a Super BASIC Application'&“$   &'HERE YOU CAN ADD MORE DESCRIPTION FOR YOUR APPLICATION'&“$                    &'and even more... (this example description is for width 512 and BORDER 1,clr)'
151 :
152 REMark !!! IMPORTANT: FIRST set the program name in FuNction __PROG_NAME__$ !!!
160 :
170 REMark Up to 199 RESERVED for loading (LRESPRing) extensions:
190 OPEN#5,'con_512x400a40x328':CLS#5:REMark DEBUG channel
200 :
210 REMark Constants (all in capitals), global variables, ...:
220 :
230 REMark Define size, color, ... for initial CON channels 0 and 1:
240 _W0XS_%=512:_W0YS_%=52:_W0X_%=512:_W0Y_%=432
250 _PAPER0_%=0:_INK0_%=4:DIM _BORDER0_%(1):_BORDER0_%(0)=1:_BORDER0_%(1)=255
260 _W1XS_%=512:_W1YS_%=400:_W1X_%=512:_W1Y_%=30
270 _PAPER1_%=4:_INK1_%=0:DIM _BORDER1_%(1):_BORDER1_%(0)=1:_BORDER1_%(1)=255
3000 :
3010 REMark Initialisations:
3020 :
3040 resetCONs
3080 PRINT'Hello world'\\
3090 PRINT _DESCRIPTION_$
7000 :
7010 :
7020 REMark Special PROCedures and FuNctions for the main program. DO NOT ALTER THEM:
7030 :
7040 DEFine PROCedure resetCONs
7050   OPEN#0,'CON':WINDOW#0,_W0XS_%,_W0YS_%,_W0X_%,_W0Y_%
7060   BORDER#0,_BORDER0_%(0),_BORDER0_%(1):PAPER#0,_PAPER0_%:INK#0,_INK0_%:CLS#0
7070   IF VER$<>'HBA':HISTORY#0,100
7080   OPEN#1,'CON':WINDOW _W1XS_%,_W1YS_%,_W1X_%,_W1Y_%
7090   BORDER _BORDER1_%(0),_BORDER1_%(1):PAPER _PAPER1_%:INK _INK1_%:CLS
7100 END DEFine
9970 :
9980 REMark END DEFine
9990 :
10000 :
10010 REMark PROCedures and FuNctions:
32690 :
32700 :
32704 DEFine FuNction __PROG_NAME__$
32708   RETurn 'WIN1_home_hps_bas_lib_multibas_sbt'
32712 END DEFine
32716 :
32720 DEFine PROCedure sav
32724   SAVE __PROG_NAME__$
32728 END DEFine
32732 :
32736 DEFine PROCedure reload
32740   PRINT#0,'Do you really want reload'!__PROG_NAME__$!'(y/Y to confirm) ';
32744   CURSEN#0:IF INKEY$(-1)=='y':LOAD __PROG_NAME__$:ELSE PRINT#0
32748 END IF
32752 :REMark Do _NOT_ add lines below this, some ROMs may fail(!)
Looks much better in ED with a window with width 512 and BORDER 1,255
 
 
multibas_sbt_001.png