Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetNumber(): Integer;
- var
- Input: string;
- Number: Integer;
- IsCorrect: Boolean;
- begin
- IsCorrect := False;
- repeat
- try
- Writeln('Enter P');
- Readln(Input);
- Number := StrToInt(Input);
- if Number < 1 then
- Writeln(ErrorMessage)
- else
- IsCorrect := True
- except
- Writeln(ErrorMessage);
- end;
- until IsCorrect;
- GetNumber := Number;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement