This procedure is called just before the answer is written to a binary file to ensure it is in the correct format. It works but I need it to repeat until it is an integer. I was trying to use a 'repeat','until' but wasnt sure what the 'until' condition woudld be. At the moment it displays the message and then carries on regardless.
Procedure ValidateAnswer; begin try ValidatedAnswer:=StrToInt(QuestionnaireForm.Answer.Text); except ShowMessage('Answer must be an integer'); end; end;