| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (19 out of 25)

go to

This statement explicitly transfers control to a statement with a specified label. The syntax is:

where:


An integer or symbol that labels some statement in the procedure.

The go to statement specifies the label to which G2 transfers control. The specified label must appear in the procedure. If it does not, G2 signals an error. Specifying a label requires the following syntax:

For example:

In this example, G2 transfers control of the procedure to tag5 if x is greater than 4, and returns otherwise. Note that G2 never executes the statement labeled tag4.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (19 out of 25)

Copyright © 1997 Gensym Corporation, Inc.