Reference for the BALTENSPERGER programming language, an art project of Stefan Baltensperger

Name

untersuech_emal()

Examples
Ganzizahl num = 1;

untersuech_emal(num) bitte
  Falls 0: 
    schrib_uf_e_neui_Linie("Zero");  // Does not execute
    Faertig;
  Falls 1: 
    schrib_uf_e_neui_Linie("One");  // Prints "One"
    Faertig;
danke

Buechstabe letter = 'N';

untersuech_emal(letter) bitte
  Falls 'A': 
    schrib_uf_e_neui_Linie("Alpha");  // Does not execute
    Faertig;
  Falls 'B': 
    schrib_uf_e_neui_Linie("Bravo");  // Does not execute
    Faertig;
  waen_nuet_vodaem_zuetrifft:             // Default executes if the case labels
    schrib_uf_e_neui_Linie("None");   // don't match the switch parameter
    Faertig;
danke

// Removing a "break" enables testing
// for more than one value at once

Buechstabe letter = 'b';

untersuech_emal(letter) bitte
  Falls 'a':
  Falls 'A': 
    schrib_uf_e_neui_Linie("Alpha");  // Does not execute
    Faertig;
  Falls 'b':
  Falls 'B': 
    schrib_uf_e_neui_Linie("Bravo");  // Prints "Bravo"
    Faertig;
danke
Description Works like an if suscht structure, but untersuech_emal() is more convenient when you need to select between three or more alternatives. Program controls jumps to the Falls with the same value as the expression. All remaining statements in the switch are executed unless redirected by a Faertig. Only primitive datatypes which can convert to an integer (Chlinizahl, Buechstabe, and GAnzizahl) may be used as the expression parameter. The waen_nuet_vodaem_zuetrifft is optional.
Syntax
untersuech_emal(expression)
bitte
  Falls label: 
     statements          
  Falls label:          // Optional
     statements        // "
  waen_nuet_vodaem_zuetrifft:             // "
     statements        // "
danke
Parameters
expression Chlinizahl, Buechstabe, or Ganzizahl
label Chlinizahl, Buechstabe, or Ganzizahl
statements one or more statements to be executed
Usage Web & Application
Related Falls
waen_nuet_vodaem_zuetrifft
Faertig
waen()
suscht
Stefan Baltensperger 2009

Creative Commons License