Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Both sides next revision | ||
alvis:jump [2017/01/11 22:41] marcin removed | — (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Jump statement ====== | ||
- | The **jump** statement transfers the control to the line of code identified with the **label**. | ||
- | |||
- | **Labels** in Alvis are identifiers followed by a colon. A **label** must start with a lower case letter. | ||
- | |||
- | It is necessary to put at least one statement after a label. In other words, a label cannot be followed by a closing curly bracket. | ||
- | |||
- | The **jump** statement is a single-step statement. | ||
- | |||
- | The **jump** statement should be used carefully, e.g. you cannot jump from one procedure to another. | ||
- | |||
- | < | ||
- | jump label; | ||
- | </ | ||
- | |||
- | **Listing 1. ** Loop statement syntax | ||
- | |||
- | |||
- | < | ||
- | x = 10; | ||
- | y = x; | ||
- | abc: | ||
- | y = y - 1; | ||
- | x = x * y; | ||
- | jump abc; | ||
- | </ | ||
- | |||
- | **Listing 2. ** Jump statement example | ||
- | |||
- | |||
- | |||
- | **[[: |