Goto/de: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | Zurück zu den [[Reserved words/de|reservierten Wörtern]]. | |
| 2 | 2 | ||
| 3 | - | ||
| 3 | + | Das reservierte Wort goto gehört zu den Sprungbefehlen. | |
| 4 | 4 | ||
| 5 | 5 | Mit goto springt das Programm zu einer festgelegten Markierung (label, Sprungmarke) und arbeitet ab dieser Markierung weiter. | |
| 6 | 6 | ||
| 7 | 7 | Siehe auch [[Label/de|Label]]. | |
| 8 | 8 | ||
| 9 | 9 | Beispiel für Deklaration einer Sprungmarke und der Verwendung des Sprungbefehls: | |
| 10 | 10 | ||
| 11 | 11 | ``` pascal | |
| 12 | 12 | var | |
| 13 | 13 | blnWahr: Boolean; | |
| 14 | 14 | ||
| 15 | 15 | label | |
| 16 | 16 | Sprungmarke; | |
| 17 | 17 | ||
| 18 | 18 | begin | |
| 19 | 19 | ... | |
| 20 | 20 | if blnWahr = True then Goto Sprungmarke; | |
| 21 | 21 | ... | |
| 22 | 22 | Sprungmarke: | |
| 23 | 23 | ... | |
| 24 | 24 | end; | |
| 25 | 25 | ``` | |
| 26 | 26 | ||
| 27 | - | ||
| 28 | - | ||
| 29 | 27 | Wen der Kompiler bei **Goto** motz, muss man diese Funktion aktivieren, entweder mit dem Kommandozeilenparameter **-Sg**, oder direkt in der Source mit: | |
| 30 | 28 | ||
| 31 | 29 | ``` pascal | |
| 32 | 30 | {$goto on} // Goto möglich | |
| 33 | 31 | {$goto off} // Goto nicht möglich | |
| 34 | 32 | ``` | |
| 35 | 33 | ||
| 36 | 34 | --- | |
| 37 | 35 | *From the Free Pascal wiki, page "Goto/de", as it stood on 2020-02-16 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
