BBC4W Output Window

Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
Voxel
Posts: 1
Joined: Sun 06 May 2018, 22:44

BBC4W Output Window

Post by Voxel »

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
Richard Russell
Posts: 366
Joined: Tue 18 Jun 2024, 09:32

Re: BBC4W Output Window

Post by Richard Russell »

Voxel wrote: Mon 05 May 2025, 10:29 When I run the program and I generate an output screen print I would like to have it on an independent 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) 
where the definition of PROCexecute is:

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