Restore

Sets where the next Read starts in the Data

Keywords

Parameters & Returns

Parameters

This function takes no parameters.

Returns

Void

Quick Summary

Sets where the next Read starts in the Data

Technical Exegesis...

Sets which Data value the next Read takes. Restore on its own goes back to the first value in the program. Restore name goes to a label: a line .name on its own marks the place, just before the Data it belongs to. Write the label's name without the dot after Restore.

Labels are not case-sensitive, and a label used twice or a Restore to a label that doesn't exist is a build error. Restore must be inside a Function or Method.

Example

Example.bam
.colours
Data "Red", "Green", "Blue"

Function Main()
    Local c:String
    Read c
    Print c              ; Red
    Restore colours
    Read c
    Print c              ; Red again
    Return 0
EndFunction