[###############################################################################################]
[$ sub Kurslink $][$endsub$]
[###############################################################################################]
[$ sub cell $]
		[$if !$rec -> {id} $]
        
			| [- Neulink -] [$ elsif $fdat{bereich_id} eq 'f' || !$kurs -> {-gebucht} || $xkurs $]
		
			[$if $xkurs $]   | [- Kurslink -] [$else$] {-gebucht}?"/images/leer_rot.gif":"/images/leer_gelb.gif") +]"> | [- Kurslink -] [$endif$]
		
		[$ elsif $fdat{bereich_id} eq 'b' $]
		
            [- $n = 2 -] | [$ endif $]
[$endsub $]
[###############################################################################################]
[-
$rec  = { id => 1 } ;
$kurs = { -gebucht => 1 } ;
$brec = { id => 2, bereichkurz => 'bu' } ;
$fdat{bereich_id} = 'b' ;
$bgcol = '#1' ;
$gifext = 'xxx' ;
$l = 2 ;
-] 
				| [- Kurslink -] [$ while ($n--) $]
                    [-  
                    $banzahl = 1 ;
                    $sanzahl = 5 ;
					-]
                    [$ if $banzahl > 0  $] | [- Kurslink (($sanzahl || 0) . "/$banzahl") -] [+ $brec -> {bereichkurz} +][$endif$]
                [$endwhile$] |  | 
	
    [$ while ($l-- > 0) $]
        [- cell -]
    [$endwhile$]