Добавил:
Xer1t
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Лаба 6 вар 9 / module / Sint
.pas unit Sint;
interface
procedure Control(var Symbol:char; Pole:string);
function Control2(Stroka:string):boolean;
implementation
procedure Control(var Symbol:char; Pole:string);//контроль вводимых символов
begin
case Symbol of
'0'..'9': ;
#13:;
#8: ;
'-': if Pos('-',Pole)<>0 then Symbol:=#0;
',': if Pos(',',Pole)<>0 then Symbol:=#0;
else Symbol:=#0;
end;
end;
function Control2(Stroka:String):boolean;
begin
if (Stroka='') or (Stroka='-')
or ((Pos('-', Stroka)<>0) and (Pos('-', Stroka)<>1))
then Control2:=false else Control2:=true;
end;
end.
interface
procedure Control(var Symbol:char; Pole:string);
function Control2(Stroka:string):boolean;
implementation
procedure Control(var Symbol:char; Pole:string);//контроль вводимых символов
begin
case Symbol of
'0'..'9': ;
#13:;
#8: ;
'-': if Pos('-',Pole)<>0 then Symbol:=#0;
',': if Pos(',',Pole)<>0 then Symbol:=#0;
else Symbol:=#0;
end;
end;
function Control2(Stroka:String):boolean;
begin
if (Stroka='') or (Stroka='-')
or ((Pos('-', Stroka)<>0) and (Pos('-', Stroka)<>1))
then Control2:=false else Control2:=true;
end;
end.