Suppress SPOOL...

Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
Post Reply
User avatar
hellomike
Posts: 50
Joined: Sat 09 Jun 2018, 09:47

Suppress SPOOL...

Post by hellomike » Fri 14 Jun 2019, 15:35

Hi,

Probably it isn't easily possible but maybe I'm unaware off a nifty trick so lets post this anyhow....

To have all PRINT output on screen also saved as file, obviously *SPOOL is how to do that, as it was 30 years ago.
Obviously it saves all VDU output, hence also the COLOUR VDU bytes (17,...).
When post processing the text file saved, these characters pose a problem.

There are VDU chars to disable and enable output to screen (21 and 6) or to printer (3 and 2),
but not, I think, for disable and enable output to the current open SPOOL file.

Anyone found a straight forward way around this? I mean, apart form closing and then open/append to the SPOOL file.

Currently I'm using the following horrible solution to post process after closing the SPOOL file:

Code: Select all

      F%=OPENUPSPOOLFILE$ : IF F%=0 END
      WHILE NOT EOF#F% : B%=BGET#F% : IF B%=17 OR B%=1 OR B%=2 OR B%=3 THEN PTR#F%=PTR#F% - 1 : BPUT#F%, 32
      ENDWHILE : CLOSE#F%
At least it is transparent for the entire program above it but this still leaves unwanted spaces.

Thanks

Mike

RichardRussell
Posts: 44
Joined: Tue 15 Oct 2019, 09:10

Re: Suppress SPOOL...

Post by RichardRussell » Sun 27 Oct 2019, 10:14

hellomike wrote:
Fri 14 Jun 2019, 15:35
Anyone found a straight forward way around this? I mean, apart form closing and then open/append to the SPOOL file.
Not particularly straightforward or elegant, not least because the spool channel can be either 32 or 64-bits depending on the platform, but you could try this technique:

Code: Select all

      *spool filtered.txt
      PRINT "Here is some ";
      PROCcolour(2)
      PRINT "green";
      PROCcolour(0)
      PRINT " text"
      *spool
      END

      DEF PROCcolour(N%)
      IF INKEY$(-256)<>"W" IF @platform% AND &40 LOCAL @hfile%(14) ELSE LOCAL !536
      COLOUR N%
      ENDPROC
My posts are moderated; if you are seeing this it has already been approved. If you have a comment about the style or tone of the message please report it to the moderators by clicking the exclamation mark icon rather than complaining on the public forum.

User avatar
hellomike
Posts: 50
Joined: Sat 09 Jun 2018, 09:47

Re: Suppress SPOOL...

Post by hellomike » Sun 27 Oct 2019, 20:43

Hi Richard,

It is for BB4W. This neat trick is far more elegant than what I use now.

Thanks a lot and happy to have you back at full force.

Mike

RichardRussell
Posts: 44
Joined: Tue 15 Oct 2019, 09:10

Re: Suppress SPOOL...

Post by RichardRussell » Sun 27 Oct 2019, 21:30

hellomike wrote:
Sun 27 Oct 2019, 20:43
It is for BB4W.
In that case all you need is LOCAL !536 (documented at the wiki, so didn't need any 'inside knowledge') but I don't like posting code which is edition-specific. I rarely use BB4W myself, and am increasingly unlikely to, so I need solutions that will run in BBCSDL.
happy to have you back at full force.
Only for a short time, I fear. One thing I'm finding hard to tolerate is not being able to review or edit posts after I submit them. They disappear into a 'moderation queue' and are inaccessible. A better forum design would allow you to view and edit (or even delete) pending posts up until the point they are approved or rejected.
My posts are moderated; if you are seeing this it has already been approved. If you have a comment about the style or tone of the message please report it to the moderators by clicking the exclamation mark icon rather than complaining on the public forum.

KenDown
Posts: 86
Joined: Wed 04 Apr 2018, 06:36

Re: Suppress SPOOL...

Post by KenDown » Mon 28 Oct 2019, 04:32

It should be pointed out that Richard's posts are moderated as a way of enabling him to feel comfortable about posting here. The step was taken in full consultation between Richard and DDRM, who is in charge of the forum. (I am a sort of assistant mod because DDRM is busy at university.) So far, to the best of my knowledge, no post by Richard has been rejected and posts are checked and approved as soon as we are notified about them.

The design of the forum is not up to us but is part of the hosting package. It is a shame that the editing/deleting facilities are different for moderated posts, but I don't think there is anything we can do about it. It is certainly not a deliberate choice by anyone here.

Like you, Mike, we are just happy to have Richard back and posting and hope that it will long continue.

RichardRussell
Posts: 44
Joined: Tue 15 Oct 2019, 09:10

Re: Suppress SPOOL...

Post by RichardRussell » Mon 28 Oct 2019, 23:42

KenDown wrote:
Mon 28 Oct 2019, 04:32
It should be pointed out that Richard's posts are moderated as a way of enabling him to feel comfortable about posting here.
The 'rationale' for my posts being moderated was explained in detail by the forum's admin here. It's not true that it makes me feel "comfortable", indeed the opposite is the case. :(

My proposal to the forum's admin was that those members who have, from time to time, criticised my posts in a way that I judged unfair or unkind might themselves be moderated, so that I could be sure that any future criticism had at least been considered valid by somebody else. His counter proposal was that instead of (or as well as) them being moderated, I should be.

I agreed, but I find being moderated quite difficult to cope with.
My posts are moderated; if you are seeing this it has already been approved. If you have a comment about the style or tone of the message please report it to the moderators by clicking the exclamation mark icon rather than complaining on the public forum.

Post Reply