[mkinl7.inc] { =================================================== } { Das MKINL Programm -- INCLUDE Dateien } { } { TEIL 7 : Parametereingabe Funktionen } { } { =================================================== } procedure def_opt; var cc : char; HexInp : HexString; OK : boolean; begin write('Ausgabe als Inline, Konstante or Phase [I,(K,P)] : '); repeat read(kbd,cc); cc:=UpCase(cc); until cc in [cr,'I','K','P']; writeln; case cc of cr,'I' : OutMode:=INL; 'K' : OutMode:=CONS; 'P' : begin write('Eingabe HEX Phase PC : '); GetCursor; repeat readln(HexInp); OK:=HexToDec(HexInP); if not OK then flash('Fehler in der Hexzahl'); until OK; OutMode:=PHASE; end; end; end; function get_opt(opt:anystring):InlMode; var lft,rgt : byte; HxStr : AnyString; optOk : boolean; optMod : InlMode; begin lft:=pos('[',opt); rgt:=pos(']',opt); optOK:=((rgt-lft=2) and (lft>0)); if optOK then case opt[succ(lft)] of 'I' : optMod:=INL; 'K' : optMod:=CONS; else optOK:=false; end else begin if ((opt[lft+1]='P') and (opt[lft+2]='=')) then begin HxStr:=copy(opt,lft+3,rgt-lft-3); optOk:=HexToDec(HxStr); optMod:=PHASE; end; end; if optOk then get_opt:=optMod else IOErr('Fehler in der Option : '+opt); end;