!Teletext Script
Annotated version of 'bbcnewswhizz'

 

As for 'bbcnews', this script was written in January 2002.

This time, we are whizzing - by fetching four frames in one pass. Please note that this MAY NOT WORK on slower machines, or if your machine is 'laden'.

Note, also, that we've shaved the time down to one minute fifty nine. Or, in other words, we only saved sixteen seconds. You can only go so fast...

; Script to fetch news articles on BBC ceefax, in whizz time!
;
; Timed at 1 minute, 59 seconds.

¤script "bbcnewswhz"

; Select channel
channel(1)

; check we are receiving
getframe(100)
set A to status(pagefound)
if (A ! 1) error("Timed out trying to fetch page - is antenna connected?")

set A to 104
set E to 109

.fetchloop
  getframe(A)
  set F to A
  add(F, 5)
  getframe(F)
  add(F, 5)
  getframe(F)
  add(F, 5)
  getframe(F)
  A++
  if(A [ E) go("fetchloop")
Now, there's not enough time to process four frames in the roll-around, so we fetch first and process once we have the frames. Generally, I prefer this method of processing (instead of process-as-fetched).
As you can see, we're back to a simple processing loop.
set A to 104
set E to 124

.processloop
  set B to 1
  selectframe(A)
  set C to 1
  .omittop
    omitline(C)
    C++
    if(C [ 5) go("omittop")
  set C to 22
  .omitend
    omitline(C)
    C++
    if(C [ 25) go("omitend")
  storeframe()
  A++
  if(A [ E) go("processloop")
And, you know this bit...
filewrite("<Teletext$Temp>.bbcnews")
set A to 104
set E to 124
.outputframes
  appendframe(A, 2)
  filewritebyte(10)
  filewritebyte(10)
  A++
  if(A [ E) go("outputframes")
fileclose()
filetype("<Teletext$Temp>.bbcnews", &FFF)
oscall("%Filer_Run <Teletext$Temp>.bbcnews")

terminate()

Return to !Teletext index
Copyright © 2003 Richard Murray