Copyright 2008 Shoptalk Systems

RESTORE [optional branch label or line number]

Description:

RESTORE will reset the reading of DATA statements so that the next READ will get information from the first DATA statement in the program (or the first DATA statement in a function or subroutine, if this is where the RESTORE is executed).  RESTORE without a branch label or line number will reset to the beginning of the first DATA item.

Example:

[loop]
  input "set 1, 2 or 3"; a
  select case a
    case 1
      restore 100
    case 2
      restore 200
    case 3
      restore 300
    case else
      print "Try again."
      goto [loop]
  end select
  for x = 1 to 3
    read a$
    print a$
  next x
  goto [loop]

100 data "a", "b", "c"
200 data "d", "e", "f"
300 data "g", "h", "i"

See also: READ, DATA