Changes between Version 1 and Version 2 of GotoExample
- Timestamp:
- 01/23/06 08:51:19 (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GotoExample
v1 v2 12 12 #!d 13 13 /* 14 15 14 File: goto.d 16 15 Date: 2004-02-16 18 17 License: Public Domain 19 18 Purpose: Shows the usage of goto and labels. 19 Edited: 2006-01-23, Christopher Nicholson-Sauls 20 20 21 21 Why goto is part of the D programming language... 32 32 */ 33 33 34 import std.stdio; 34 35 35 void main() 36 { 36 void main () { 37 37 38 38 thebeginning: 39 printf("The beginning\n");39 writefln("The beginning"); 40 40 41 41 part1: 42 printf("Part 1\n");42 writefln("Part 1"); 43 43 44 44 part2: 45 printf("Part 2\n");45 writefln("Part 2"); 46 46 goto part5; 47 47 48 48 part3: 49 printf("Part 3\n");49 writefln("Part 3"); 50 50 51 51 part4: 52 printf("Part 4\n");52 writefln("Part 4"); 53 53 54 54 part5: 55 printf("Part 5\n");55 writefln("Part 5"); 56 56 57 57 theend: 58 printf("The end\n"); 59 58 writefln("The end"); 60 59 } 61 60 }}} 62 61 63 == Source == 64 65 || Link || http://www.dsource.org/tutorials/index.php?show_example=89 || 66 || Posted by || jcc7 || 67 || Date/Time || Wed May 19, 2004 6:02 pm || 62 == Output == 63 {{{ 64 The beginning 65 Part 1 66 Part 2 67 Part 5 68 The end 69 }}}