.<label>

Under RISC OS, you may only define a maximum of 16 labels. The Windows script interpreter has no such limitation.

Description

Labels permit you to assign a specific line as a branch point, a sort of bookmark to which your script code may jump.

Notes

The actual pointer of a label is the line following the label. So in the example below, the label scanloop, when jumped to, would have execution start with the cache_loadnextentry() line.
This behaviour is by design (to avoid wasting time interpreting the label line), and is documented purely for completeness.

Examples

Labels are an essential part of looping, as this example demonstrates:
  set A to 0
  .scanloop
    cache_loadnextentry(A)
    if (A = -1) go("scanend")
      [code to fiddle with the frame data goes here]
    if (A ! -1) go("scanloop")

  .scanend
    [and so on...]

There is a more powerful form of control where you may call() and return() to create simple functions, as this brain-dead example demonstrates:

  set A to 1
  call(writebyte)
  set A to 2
  call(writebyte)
  set A to 3
  call(writebyte)
  [etc etc more code etc etc]

  .writebyte
    file_writebyte(A)
    return()

Specifics

Under Windows, multiple definitions of the same label will be faulted. Under RISC OS, subsequent definitions would be ignored.

Quirk

Under RISC OS, jumping to labels tended to mess up the line counter and the 'how much has been done' percentage counter.