Hello everyone,
I am an occasional BBC Basic programmer and I am currently trying to build a simple text editor which is still at a very early stage.
When I run the program and I generate an output screen print I would like to have it on an independent Window. Kind of those old “C “IDEs.
Is there a way to output to external Windows? I could not find a solution.
Many thanks,
Gian
BBC4W Output Window
-
- Posts: 366
- Joined: Tue 18 Jun 2024, 09:32
Re: BBC4W Output Window
There are several ways of achieving that, but one of the simplest is to 'spawn' another copy of BBC BASIC. Whilst it may superficially seem wasteful to have multiple copies running at the same time, it actually makes good use of the multicore CPUs present in virtually every modern PC.
For example if you look at the code of SDLIDE.bbc you will see that it opens the 'Compile' dialogue that way:
Code: Select all
PROCexecute(@dir$ + "compiler.bbc", FNdark)
Code: Select all
DEF PROCexecute(bbcfile$, flag$)
ON ERROR LOCAL IF FALSE THEN
IF BB4W% THEN
OSCLI "RUN """ + @lib$ + "..\bbcwrun6.exe"" """ + bbcfile$ + """ " + flag$ + ";"
ELSE
CASE @platform% AND &F OF
WHEN 0:
SYS "WinExec", """" + @lib$ + "..\bbcsdl"" """ + bbcfile$ + """ " + flag$, 1
OTHERWISE:
OSCLI "RUN """ + @lib$ + "../bbcsdl"" """ + bbcfile$ + """ " + flag$ + ";"
ENDCASE
ENDIF
ENDIF : RESTORE ERROR
ENDPROC