{ HLOUSEK.PAS Copyright (c) Lukas Hlousek } { Unit pre program na simulaci pokladny. } { } { Datum:10.01.2007 http://www.trsek.com } unit Hlousek; interface function VyberVolbu(Text:string; Nabidka:string):char; implementation uses crt; function VyberVolbu(Text:string; Nabidka:string):char; var vybrano: char; pozice: byte; begin Write(Text+' '); repeat vybrano:=UpCase(ReadKey); pozice:=Pos(vybrano,nabidka); if pozice=0 then begin Sound(500); Delay(20000); NoSound; end; until pozice<>0; VyberVolbu:=vybrano; end; { Vstup z klavesnice s omezenim poctu znaku } uses Crt; const CR=#13; BS=#8; Num=['0','1','2','3','4','5','6','7','8','9']; var InpBuf: string; InpChr: char; MaxLen: byte; begin MaxLen:=8; ClrScr; InpChr:=#0; InpBuf:=''; while InpChr<>#13 do begin InpChr:=ReadKey; case InpChr of BS: Delete(InpBuf,Length(InpBuf),1); else if (Length(InpBuf)