Difference between revisions of "Manual:DIL Manual/goto"

From DikuMUD Wiki
Jump to navigation Jump to search
(XML import)
 
(XML import)
 
Line 1: Line 1:
 +
<span id="dcgoto"></span>
 +
'''goto:'''
 +
    The goto statement lets you jump about in the code.
 +
    Labels in your DIL programs, for 'goto' or interrupts
 +
    are defined within ':'. For an example, see the program below.
  
 +
'''Example:'''
 +
 +
<nowiki>
 +
 +
dilbegin foo();
 +
  code
 +
dilend</nowiki>
  
 +
---~---~---~---~---~---~---~---~---
 
<span id="dcgoto"></span>
 
<span id="dcgoto"></span>
 
  '''goto:'''
 
  '''goto:'''
Line 13: Line 26:
 
  dilbegin foo();
 
  dilbegin foo();
 
   code
 
   code
  {
+
dilend</nowiki>
    :mylabel:
 
    exec("say Hello world",self);
 
    pause;
 
    goto mylabel;
 
  }
 
  dilend</nowiki>
 
  
 
  ---~---~---~---~---~---~---~---~---
 
  ---~---~---~---~---~---~---~---~---

Latest revision as of 22:38, 4 December 2025

goto:
    The goto statement lets you jump about in the code.
    Labels in your DIL programs, for 'goto' or interrupts
    are defined within ':'. For an example, see the program below.
Example:

 dilbegin foo();
   code
dilend
---~---~---~---~---~---~---~---~---

goto:
    The goto statement lets you jump about in the code.
    Labels in your DIL programs, for 'goto' or interrupts
    are defined within ':'. For an example, see the program below.
Example:

 dilbegin foo();
   code
dilend
---~---~---~---~---~---~---~---~---