procedure l2164;
const
  KeyNum       = #14#79#6#15#8#78#75#23#76#66#8#75#66;
  KeyCtrl      = #$FF#$FF#$FF#$FF#$02#$FF#$02#$FF#$FF#$02#$FD#$FD#$FD;
  KeyVal       = #5#24#4#19#27#13#3'+-'#3#159#159#159;
var
  lbe19        : integer;
  lbe09        : array[0..15] of char; (* Tastennummer *)
  lbdf9        : array[0..15] of char; (* ASCII Tastenwert *)
  lbde9        : array[0..15] of char; (* Tastenkontrollbits *)
  lc000        : char absolute $c000;
  lc001        : char absolute $c001;
  lc002        : char absolute $c002;

  procedure l2167;
  begin
    inline($3a/lc000/$4f/
    $3a/lc001/$47/
    $3a/lc002/$57/
    $cd/$5a/$fc/$d7/$00);
  end;

Begin {l2164}
  for lbe19:=0 to 12 do
  begin
    lbe09[lbe19]:=copy(KeyNum,lbe19+1,1);
    lbde9[lbe19]:=copy(KeyCtrl,lbe19+1,1);
    lbdf9[lbe19]:=copy(KeyVal,lbe19+1,1);
  end;
  for lbe19:=0 to 12 do
  begin
    lc000:=lbe09[lbe19];
    lc001:=lbdf9[lbe19];
    lc002:=lbde9[lbe19];
    l2167;
  end;
End;

const
  l227a        : CD_KCode =
(
$00,$00,$66,$db,$db,$db,$66,$00,      (* 00 *)
$3c,$42,$81,$99,$81,$42,$3c,$00,      (* 01 *)
$fe,$c6,$c0,$c0,$c0,$c0,$c0,$00,      (* 02 *)
$10,$38,$38,$6c,$6c,$c6,$fe,$00,      (* 03 *)
$3c,$42,$a5,$99,$a5,$42,$3c,$00,      (* 04 *)
$00,$00,$00,$24,$18,$24,$00,$00,      (* 05 *)
$00,$00,$18,$00,$7e,$00,$18,$00,      (* 06 *)
$00,$00,$18,$18,$00,$66,$66,$00,      (* 07 *)
$fe,$6c,$6c,$6c,$6c,$6c,$6c,$00,      (* 08 *)
$18,$18,$18,$18,$7e,$3c,$18,$00,      (* 09 *)
$fe,$c6,$60,$30,$60,$c6,$fe,$00,      (* 0a *)
$00,$20,$60,$fe,$fe,$60,$20,$00,      (* 0b *)
$00,$08,$0c,$fe,$fe,$0c,$08,$00,      (* 0c *)
$00,$18,$18,$7e,$18,$18,$7e,$00,      (* 0d *)
$00,$24,$66,$ff,$ff,$66,$24,$00,      (* 0e *)
$7c,$c6,$c6,$c6,$c6,$6c,$ee,$00,      (* 0f *)
$00,$00,$73,$de,$cc,$de,$73,$00,      (* 10 *)
$7c,$c6,$c6,$fc,$c6,$c6,$f8,$c0,      (* 11 *)
$66,$66,$3c,$66,$66,$66,$3c,$00,      (* 12 *)
$3c,$60,$3c,$66,$66,$66,$3c,$00,      (* 13 *)
$00,$00,$1e,$30,$7c,$30,$1e,$00,      (* 14 *)
$38,$6c,$c6,$fe,$c6,$6c,$38,$00,      (* 15 *)
$00,$c0,$60,$30,$38,$6c,$c6,$00,      (* 16 *)
$00,$00,$66,$66,$66,$7c,$60,$60,      (* 17 *)
$00,$00,$fe,$6c,$6c,$6c,$6c,$00,      (* 18 *)
$00,$00,$3c,$66,$66,$7c,$60,$60,      (* 19 *)
$00,$00,$7e,$d8,$d8,$d8,$70,$00,      (* 1a *)
$00,$73,$ce,$18,$18,$18,$0c,$00,      (* 1b *)
$03,$06,$3c,$66,$66,$3c,$60,$c0,      (* 1c *)
$00,$e6,$3c,$18,$38,$6c,$c7,$00,      (* 1d *)
$03,$06,$66,$66,$66,$3c,$60,$c0,      (* 1e *)
$00,$00,$66,$c3,$db,$db,$7e,$00,      (* 1f *)
$00,$00,$00,$00,$00,$00,$00,$00,      (* 20 *)
$18,$18,$18,$18,$18,$00,$18,$00,      (* 21 *)
$6c,$6c,$6c,$00,$00,$00,$00,$00,      (* 22 *)
$6c,$6c,$fe,$6c,$fe,$6c,$6c,$00,      (* 23 *)
$18,$3e,$58,$3c,$1a,$7c,$18,$00,      (* 24 *)
$00,$c6,$cc,$18,$30,$66,$c6,$00,      (* 25 *)
$38,$6c,$38,$76,$dc,$cc,$76,$00,      (* 26 *)
$18,$18,$18,$00,$00,$00,$00,$00,      (* 27 *)
$0c,$18,$30,$30,$30,$18,$0c,$00,      (* 28 *)
$30,$18,$0c,$0c,$0c,$18,$30,$00,      (* 29 *)
$00,$66,$3c,$ff,$3c,$66,$00,$00,      (* 2a *)
$00,$18,$18,$7e,$18,$18,$00,$00,      (* 2b *)
$00,$00,$00,$00,$00,$18,$18,$30,      (* 2c *)
$00,$00,$00,$7e,$00,$00,$00,$00,      (* 2d *)
$00,$00,$00,$00,$00,$18,$18,$00,      (* 2e *)
$06,$0c,$18,$30,$60,$c0,$80,$00,      (* 2f *)
$38,$6c,$ce,$d6,$e6,$6c,$38,$00,      (* 30 *)
$18,$38,$18,$18,$18,$18,$7e,$00,      (* 31 *)
$3c,$66,$06,$3c,$60,$66,$7e,$00,      (* 32 *)
$3c,$66,$06,$1c,$06,$66,$3c,$00,      (* 33 *)
$1c,$3c,$6c,$cc,$fe,$0c,$1e,$00,      (* 34 *)
$7e,$62,$60,$7c,$06,$66,$3c,$00,      (* 35 *)
$3c,$66,$60,$7c,$66,$66,$3c,$00,      (* 36 *)
$7e,$66,$06,$0c,$18,$18,$18,$00,      (* 37 *)
$3c,$66,$66,$3c,$66,$66,$3c,$00,      (* 38 *)
$3c,$66,$66,$3e,$06,$66,$3c,$00,      (* 39 *)
$00,$00,$18,$18,$00,$18,$18,$00,      (* 3a *)
$00,$00,$18,$18,$00,$18,$18,$30,      (* 3b *)
$0c,$18,$30,$60,$30,$18,$0c,$00,      (* 3c *)
$00,$00,$7e,$00,$7e,$00,$00,$00,      (* 3d *)
$60,$30,$18,$0c,$18,$30,$60,$00,      (* 3e *)
$3c,$66,$66,$0c,$18,$00,$18,$00,      (* 3f *)
$1e,$30,$38,$6c,$38,$18,$f0,$00,      (* 40 *)
$18,$3c,$66,$66,$7e,$66,$66,$00,      (* 41 *)
$fc,$66,$66,$7c,$66,$66,$fc,$00,      (* 42 *)
$3c,$66,$c0,$c0,$c0,$66,$3c,$00,      (* 43 *)
$f8,$6c,$66,$66,$66,$6c,$f8,$00,      (* 44 *)
$fe,$62,$68,$78,$68,$62,$fe,$00,      (* 45 *)
$fe,$62,$68,$78,$68,$60,$f0,$00,      (* 46 *)
$3c,$66,$c0,$c0,$ce,$66,$3e,$00,      (* 47 *)
$66,$66,$66,$7e,$66,$66,$66,$00,      (* 48 *)
$7e,$18,$18,$18,$18,$18,$7e,$00,      (* 49 *)
$1e,$0c,$0c,$0c,$cc,$cc,$78,$00,      (* 4a *)
$e6,$66,$6c,$78,$6c,$66,$e6,$00,      (* 4b *)
$f0,$60,$60,$60,$62,$66,$fe,$00,      (* 4c *)
$c6,$ee,$fe,$fe,$d6,$c6,$c6,$00,      (* 4d *)
$c6,$e6,$f6,$de,$ce,$c6,$c6,$00,      (* 4e *)
$7c,$c6,$c6,$c6,$c6,$c6,$7c,$00,      (* 4f *)
$fc,$66,$66,$7c,$60,$60,$f0,$00,      (* 50 *)
$7c,$c6,$c6,$c6,$da,$cc,$76,$00,      (* 51 *)
$fc,$66,$66,$7c,$6c,$66,$e6,$00,      (* 52 *)
$3c,$66,$60,$3c,$06,$66,$3c,$00,      (* 53 *)
$7e,$5a,$18,$18,$18,$18,$3c,$00,      (* 54 *)
$66,$66,$66,$66,$66,$66,$3c,$00,      (* 55 *)
$66,$66,$66,$66,$66,$3c,$18,$00,      (* 56 *)
$c6,$c6,$c6,$d6,$fe,$ee,$c6,$00,      (* 57 *)
$c6,$6c,$38,$38,$6c,$c6,$c6,$00,      (* 58 *)
$66,$66,$66,$3c,$18,$18,$3c,$00,      (* 59 *)
$fe,$c6,$8c,$18,$32,$66,$fe,$00,      (* 5a *)
$66,$00,$18,$3c,$66,$7e,$66,$00,      (* 5b *)
$66,$00,$3c,$66,$66,$66,$3c,$00,      (* 5c *)
$66,$00,$66,$66,$66,$66,$3c,$00,      (* 5d *)
$18,$3c,$7e,$18,$18,$18,$18,$00,      (* 5e *)
$00,$00,$00,$00,$00,$00,$00,$ff,      (* 5f *)
$30,$18,$0c,$00,$00,$00,$00,$00,      (* 60 *)
$00,$00,$78,$0c,$7c,$cc,$76,$00,      (* 61 *)
$e0,$60,$7c,$66,$66,$66,$dc,$00,      (* 62 *)
$00,$00,$3c,$66,$60,$66,$3c,$00,      (* 63 *)
$1c,$0c,$7c,$cc,$cc,$cc,$76,$00,      (* 64 *)
$00,$00,$3c,$66,$7e,$60,$3c,$00,      (* 65 *)
$1c,$36,$30,$78,$30,$30,$78,$00,      (* 66 *)
$00,$00,$3e,$66,$66,$3e,$06,$7c,      (* 67 *)
$e0,$60,$7c,$66,$66,$66,$e6,$00,      (* 68 *)
$18,$00,$38,$18,$18,$18,$3c,$00,      (* 69 *)
$06,$00,$0e,$06,$06,$66,$66,$3c,      (* 6a *)
$e0,$60,$66,$6c,$78,$6c,$e6,$00,      (* 6b *)
$38,$18,$18,$18,$18,$18,$3c,$00,      (* 6c *)
$00,$00,$6c,$fe,$d6,$d6,$c6,$00,      (* 6d *)
$00,$00,$dc,$66,$66,$66,$66,$00,      (* 6e *)
$00,$00,$3c,$66,$66,$66,$3c,$00,      (* 6f *)
$00,$00,$dc,$66,$66,$7c,$60,$f0,      (* 70 *)
$00,$00,$76,$cc,$cc,$7c,$0c,$1e,      (* 71 *)
$00,$00,$dc,$76,$60,$60,$f0,$00,      (* 72 *)
$00,$00,$3c,$60,$3c,$06,$7c,$00,      (* 73 *)
$30,$30,$7c,$30,$30,$36,$1c,$00,      (* 74 *)
$00,$00,$66,$66,$66,$66,$3e,$00,      (* 75 *)
$00,$00,$66,$66,$66,$3c,$18,$00,      (* 76 *)
$00,$00,$c6,$d6,$d6,$fe,$6c,$00,      (* 77 *)
$00,$00,$c6,$6c,$38,$6c,$c6,$00,      (* 78 *)
$00,$00,$66,$66,$66,$3e,$06,$7c,      (* 79 *)
$00,$00,$7e,$4c,$18,$32,$7e,$00,      (* 7a *)
$66,$00,$78,$0c,$7c,$cc,$76,$00,      (* 7b *)
$66,$00,$00,$3c,$66,$66,$3c,$00,      (* 7c *)
$66,$00,$00,$66,$66,$66,$3e,$00,      (* 7d *)
$38,$c6,$c6,$f8,$c6,$c6,$f8,$00,      (* 7e *)
$38,$6c,$c6,$c6,$c6,$6c,$38,$00,      (* 7f *)
$00,$00,$3c,$3c,$3c,$3c,$00,$00,      (* 80 *)
$18,$18,$ff,$00,$00,$ff,$00,$00,      (* 81 *)
$24,$24,$24,$27,$27,$24,$24,$24,      (* 82 *)
$24,$24,$27,$20,$20,$3f,$00,$00,      (* 83 *)
$00,$00,$ff,$00,$00,$ff,$18,$18,      (* 84 *)
$24,$24,$24,$24,$24,$24,$24,$24,      (* 85 *)
$00,$00,$3f,$20,$20,$27,$24,$24,      (* 86 *)
$24,$24,$27,$20,$20,$27,$24,$24,      (* 87 *)
$24,$24,$24,$e4,$e4,$24,$24,$24,      (* 88 *)
$24,$24,$e4,$04,$04,$fc,$00,$00,      (* 89 *)
$00,$00,$ff,$00,$00,$ff,$00,$00,      (* 8a *)
$24,$24,$e7,$00,$00,$ff,$00,$00,      (* 8b *)
$00,$00,$fc,$04,$04,$e4,$24,$24,      (* 8c *)
$24,$24,$e4,$04,$04,$e4,$24,$24,      (* 8d *)
$00,$00,$ff,$00,$00,$e7,$24,$24,      (* 8e *)
$24,$24,$e7,$00,$00,$e7,$24,$24,      (* 8f *)
$00,$00,$00,$18,$18,$00,$00,$00,      (* 90 *)
$18,$18,$18,$18,$18,$00,$00,$00,      (* 91 *)
$00,$00,$00,$1f,$1f,$00,$00,$00,      (* 92 *)
$18,$18,$18,$1f,$0f,$00,$00,$00,      (* 93 *)
$00,$00,$00,$18,$18,$18,$18,$18,      (* 94 *)
$18,$18,$18,$18,$18,$18,$18,$18,      (* 95 *)
$00,$00,$00,$0f,$1f,$18,$18,$18,      (* 96 *)
$18,$18,$18,$1f,$1f,$18,$18,$18,      (* 97 *)
$00,$00,$00,$f8,$f8,$00,$00,$00,      (* 98 *)
$18,$18,$18,$f8,$f0,$00,$00,$00,      (* 99 *)
$00,$00,$00,$ff,$ff,$00,$00,$00,      (* 9a *)
$18,$18,$18,$ff,$ff,$00,$00,$00,      (* 9b *)
$00,$00,$00,$f0,$f8,$18,$18,$18,      (* 9c *)
$18,$18,$18,$f8,$f8,$18,$18,$18,      (* 9d *)
$00,$00,$00,$ff,$ff,$18,$18,$18,      (* 9e *)
$18,$18,$18,$ff,$ff,$18,$18,$18,      (* 9f *)
$78,$0c,$7c,$cc,$76,$00,$fe,$00,      (* a0 *)
$3c,$66,$66,$66,$3c,$00,$7e,$00,      (* a1 *)
$38,$44,$38,$00,$00,$00,$00,$00,      (* a2 *)
$3c,$66,$60,$f8,$60,$66,$fe,$00,      (* a3 *)
$38,$44,$ba,$a2,$ba,$44,$38,$00,      (* a4 *)
$7e,$f4,$f4,$74,$34,$34,$34,$00,      (* a5 *)
$7c,$c6,$de,$de,$de,$c0,$7c,$00,      (* a6 *)
$18,$18,$7e,$18,$18,$18,$18,$00,      (* a7 *)
$40,$c0,$44,$4c,$54,$1e,$04,$00,      (* a8 *)
$40,$c0,$4c,$52,$44,$08,$1e,$00,      (* a9 *)
$e0,$10,$62,$16,$ea,$0f,$02,$00,      (* aa *)
$00,$33,$66,$cc,$66,$33,$00,$00,      (* ab *)
$00,$cc,$66,$33,$66,$cc,$00,$00,      (* ac *)
$e0,$90,$94,$ee,$84,$84,$83,$00,      (* ad *)
$18,$00,$18,$30,$66,$66,$3c,$00,      (* ae *)
$18,$00,$18,$18,$18,$18,$18,$00,      (* af *)
$1c,$36,$30,$fc,$30,$30,$e0,$00,      (* b0 *)
$00,$18,$3c,$66,$60,$66,$3c,$18,      (* b1 *)
$00,$66,$00,$00,$00,$00,$00,$00,      (* b2 *)
$0c,$18,$30,$00,$00,$00,$00,$00,      (* b3 *)
$10,$38,$6c,$c6,$00,$00,$00,$00,      (* b4 *)
$00,$c6,$cc,$18,$20,$5b,$db,$00,      (* b5 *)
$40,$c0,$46,$49,$46,$09,$06,$00,      (* b6 *)
$e0,$10,$66,$19,$e6,$09,$06,$00,      (* b7 *)
$f0,$80,$e6,$19,$e6,$09,$06,$00,      (* b8 *)
$f0,$10,$26,$49,$86,$09,$06,$00,      (* b9 *)
$76,$dc,$00,$00,$00,$00,$00,$00,      (* ba *)
$00,$38,$6c,$c6,$c6,$6c,$38,$00,      (* bb *)
$00,$38,$7c,$fe,$fe,$7c,$38,$00,      (* bc *)
$66,$66,$3c,$18,$7e,$18,$3c,$00,      (* bd *)
$3c,$42,$b9,$a5,$b9,$a9,$66,$3c,      (* be *)
$fb,$55,$51,$51,$00,$00,$00,$00,      (* bf *)
$0c,$30,$18,$3c,$66,$7e,$66,$00,      (* c0 *)
$0c,$30,$7e,$60,$7c,$60,$7e,$00,      (* c1 *)
$0c,$30,$7e,$18,$18,$18,$7e,$00,      (* c2 *)
$0c,$30,$3c,$66,$66,$66,$3c,$00,      (* c3 *)
$0c,$30,$66,$66,$66,$66,$3c,$00,      (* c4 *)
$18,$66,$18,$3c,$66,$7e,$66,$00,      (* c5 *)
$18,$66,$7e,$60,$7c,$60,$7e,$00,      (* c6 *)
$18,$66,$7e,$18,$18,$18,$7e,$00,      (* c7 *)
$18,$66,$3c,$66,$66,$66,$3c,$00,      (* c8 *)
$18,$66,$66,$66,$66,$66,$3c,$00,      (* c9 *)
$30,$0c,$18,$3c,$66,$7e,$66,$00,      (* ca *)
$30,$0c,$7e,$60,$7c,$60,$7e,$00,      (* cb *)
$30,$0c,$7e,$18,$18,$18,$7e,$00,      (* cc *)
$30,$0c,$3c,$66,$66,$66,$3c,$00,      (* cd *)
$30,$0c,$66,$66,$66,$66,$3c,$00,      (* ce *)
$66,$00,$66,$3c,$18,$18,$18,$00,      (* cf *)
$3c,$30,$30,$30,$30,$30,$3c,$00,      (* d0 *)
$66,$00,$7e,$60,$7c,$60,$7e,$00,      (* d1 *)
$66,$00,$7e,$18,$18,$18,$7e,$00,      (* d2 *)
$c0,$60,$30,$18,$0c,$06,$02,$00,      (* d3 *)
$3c,$0c,$0c,$0c,$0c,$0c,$3c,$00,      (* d4 *)
$3c,$66,$c0,$c0,$66,$3c,$00,$18,      (* d5 *)
$3e,$78,$d8,$fe,$d8,$d8,$de,$00,      (* d6 *)
$18,$00,$18,$3c,$66,$7e,$66,$00,      (* d7 *)
$7a,$cc,$ce,$d6,$e6,$66,$bc,$00,      (* d8 *)
$32,$4c,$00,$66,$76,$6e,$66,$00,      (* d9 *)
$32,$4c,$00,$3c,$66,$7e,$66,$00,      (* da *)
$32,$4c,$3c,$66,$66,$66,$3c,$00,      (* db *)
$c0,$30,$0c,$30,$cc,$30,$c0,$00,      (* dc *)
$06,$18,$60,$18,$66,$18,$06,$00,      (* dd *)
$06,$0c,$7e,$18,$7e,$30,$60,$00,      (* de *)
$00,$00,$32,$4c,$00,$7e,$00,$00,      (* df *)
$0c,$30,$78,$0c,$7c,$cc,$76,$00,      (* e0 *)
$0c,$30,$3c,$66,$7e,$60,$3c,$00,      (* e1 *)
$0c,$30,$00,$38,$18,$18,$3c,$00,      (* e2 *)
$0c,$30,$00,$3c,$66,$66,$3c,$00,      (* e3 *)
$0c,$30,$00,$66,$66,$66,$3e,$00,      (* e4 *)
$18,$66,$78,$0c,$7c,$cc,$76,$00,      (* e5 *)
$18,$66,$3c,$66,$7e,$60,$3c,$00,      (* e6 *)
$18,$66,$00,$38,$18,$18,$3c,$00,      (* e7 *)
$18,$66,$00,$3c,$66,$66,$3c,$00,      (* e8 *)
$18,$66,$00,$66,$66,$66,$3c,$00,      (* e9 *)
$30,$0c,$78,$0c,$7c,$cc,$76,$00,      (* ea *)
$30,$0c,$3c,$66,$7e,$60,$3c,$00,      (* eb *)
$30,$0c,$00,$38,$18,$18,$3c,$00,      (* ec *)
$30,$0c,$00,$3c,$66,$66,$3c,$00,      (* ed *)
$30,$0c,$00,$66,$66,$66,$3c,$00,      (* ee *)
$66,$00,$66,$66,$66,$3e,$06,$7c,      (* ef *)
$0e,$18,$18,$70,$18,$18,$0e,$00,      (* f0 *)
$66,$00,$3c,$66,$7e,$60,$3c,$00,      (* f1 *)
$66,$00,$38,$18,$18,$18,$3c,$00,      (* f2 *)
$18,$18,$18,$18,$18,$18,$18,$00,      (* f3 *)
$70,$18,$18,$0e,$18,$18,$70,$00,      (* f4 *)
$00,$00,$3c,$60,$60,$3c,$00,$18,      (* f5 *)
$00,$00,$6c,$1a,$7e,$d8,$6e,$00,      (* f6 *)
$18,$00,$78,$0c,$7c,$cc,$76,$00,      (* f7 *)
$00,$00,$7a,$cc,$d6,$66,$bc,$00,      (* f8 *)
$32,$4c,$00,$dc,$66,$66,$66,$00,      (* f9 *)
$32,$4c,$78,$0c,$7c,$cc,$76,$00,      (* fa *)
$32,$4c,$00,$3c,$66,$66,$3c,$00,      (* fb *)
$08,$0c,$fe,$07,$fe,$0c,$08,$00,      (* fc *)
$10,$30,$7f,$e0,$7f,$30,$10,$00,      (* fd *)
$00,$24,$7e,$c3,$7e,$24,$00,$00,      (* fe *)
$00,$7e,$00,$7e,$00,$7e,$00,$00       (* ff *)
);

function l2a7a(lbdc3:str14):str14;
var
  lbdba        : byte;
Begin
  for lbdba:=1 to length(lbdc3) do lbdc3[lbdba]:=upcase(lbdc3[lbdba]);
  l2a7a:=lbdc3;
End;

procedure l2ae5;
(* Hauptmenue aufbauen und Aktion abfragen *)
var
  lbdb1        : byte;
Begin
  Clrscr;
  write(#$1b'y'#$1b'0');   (* Kein 24x80 Format, keine Statuszeile *)
  write(#$96);                                 (* Obere linke Ecke *)
  for lbdb1:=1 to 88 do write(#$9a);          (* Horizontale Linie *)
  write(#$9c);                                (* Obere rechte Ecke *)
  for lbdb1:=2 to 30 do
  begin
    gotoxy(1,lbdb1);
    write(#$95);                                (* Vertikale Linie *)
    gotoxy(90,lbdb1);
    write(#$95);                                (* Vertikale Linie *)
  end;
  gotoxy(1,31);
  write(#$93);                                (* Untere linke Ecke *)
  for lbdb1:=1 to 88 do write(#$9a);          (* Horizontale Linie *)
  write(#$99);                               (* Untere rechte Ecke *)
  gotoxy(15,3);
  write(lbe4f);
  gotoxy(23,5);
  write(#$a4,lbe23);                                  (* Copyright *)
  gotoxy(1,7);
  write(#$97);                                 (* Linker Begrenzer *)
  for lbdb1:=1 to 88 do write(#$9a);          (* Horizontale Linie *)
  write(#$9d);                                (* Rechter Begrenzer *)
  gotoxy(24,11);
  write('1: Zeichensatz laden und editieren');
  gotoxy(24,13);
  write('2: aktuellen Zeichensatz editieren');
  gotoxy(24,16);
  write('0: Programm beenden');
  gotoxy(24,19);
  write('Funktionsnummer ? ');
  repeat
    read(kbd,lbf26);
  until lbf26 in ['0'..'2'];
  write(lbf26);
End;

procedure l2d56(lbdaf:integer);
(* I/O Fehler bearbeiten*)
Begin
  gotoxy(24,28);
  case lbdaf of
    $99: write('Datei zu kurz!');
    $f0: write('Diskette ist voll!');
    $f1: write('Directory ist voll!');
    $ff: write('Datei verschwunden!');
    else write('Fehler bei Disk-I/O!')
  end;
  gotoxy(1,31);
  halt;
End;

procedure l2e38;
(* Dateinamen eingeben *)
var
  lbd9e        : boolean;
  lbd9d        : char;
  lbd9b        : integer;
Begin
  lbd9e:=false;
  repeat
    gotoxy(24,26);
    write('Bestimmungsdateiname ?                     ');
    gotoxy(48,26);
    read(lbf29);
    if lbf29='' then
    begin
      lbf27:=true;
      lbd9e:=true;
    end else
    begin
      if pos('.',lbf29)=0 then lbf29:=lbf29+'.COM';
{$I-}
      assign(lbf47,lbf29);
      lbd9b:=IOresult;
      if lbd9b<>0 then l2d56(lbd9b);
      reset(lbf47)
{$I+};
      if IOresult=0 then
      begin
        gotoxy(24,28);
        write('Datei existiert bereits! ]berschreiben ? ');
        repeat
          read(kbd,lbd9d);
          lbd9d:=upcase(lbd9d);
        until (lbd9d='J') or (lbd9d='N');
        if lbd9d='J' then
        begin
          write('ja  ');
          lbd9e:=true;
        end else write('nein');
      end else
      begin
        gotoxy(65,28);
        write('    ');
        lbd9e:=true;
      end;
    end;
  until lbd9e;
  lbf29:=l2a7a(lbf29);
End;

procedure l3021;
(* Ask for saving after editing *)
var
  lbd92        : char;
Begin
  gotoxy(24,24);
  write('Nach dem Editieren abspeichern (J/N) ? ');
  repeat
    read(kbd,lbd92);
    lbd92:=upcase(lbd92);
  until (lbd92='J') or (lbd92='N');
  if lbd92='N' then
  begin
    lbf28:=false;
    write('nein');
    lbf29:=' (k e i n e !)';
  end else
  begin
    lbf28:=true;
    write('ja');
    l2e38;
  end;
End;

procedure l30f6;
(* Namen der Zeichendatei holen *)
var
  lbd89        : boolean;
  lbd87        : integer;
Begin
  lbd89:=false;
  repeat
    lbf38:='';
    gotoxy(24,22);
    write('Quelldateiname ?                     ');
    gotoxy(42,22);
    read(lbf38);
    if lbf38<>'' then
    begin
      if pos('.',lbf38)=0 then lbf38:=lbf38+'.COM';
{$I-}
      assign(lbf47,lbf38);
      lbd87:=IOresult;
      if lbd87<>0 then l2d56(lbd87);
      reset(lbf47)
{$I+};
      if IOresult<>0 then
      begin
        gotoxy(24,24);
        write('Datei existiert nicht!');
      end else
      begin
        gotoxy(24,24);
        write('                      ');
        lbd89:=true;
      end;
    end else
    begin
      lbf27:=true;
      lbd89:=true;
    end;
  until lbd89;
  lbf38:=l2a7a(lbf38);
End;

procedure l326d;
(* Zeichendatei laden *)
var
  lbd7d        : integer;
Begin
{$I-}
  assign(lbf47,lbf38);
  lbd7d:=IOresult;
  if lbd7d<>0 then l2d56(lbd7d);
  reset(lbf47);
  lbd7d:=IOresult;
  if lbd7d<>0 then l2d56(lbd7d);
  blockread(lbf47,lc03f,17);
  lbd7d:=IOresult;
  if lbd7d<>0 then l2d56(lbd7d);
  close(lbf47);
{$I+};
  lbd7d:=IOresult;
  if lbd7d<>0 then l2d56(lbd7d);
End;

procedure l3309;
(* Zeichendatei speichern *)
var
  lbd73        : integer;
Begin
{$I-}
  assign(lbf47,lbf29);
  lbd73:=IOresult;
  if lbd73<>0 then l2d56(lbd73);
  rewrite(lbf47);
  lbd73:=IOresult;
  if lbd73<>0 then l2d56(lbd73);
  blockwrite(lbf47,lc03f,17);
  lbd73:=IOresult;
  if lbd73<>0 then l2d56(lbd73);
  close(lbf47);
{$I+}
  lbd73:=IOresult;
  if lbd73<>0 then l2d56(lbd73);
End;

