begin
// Ask the user
for their name
ShowMessage('Name = '+AskForName);
end;
// Ask the user for first and second names
function
TForm1.AskForName: string;
var
firstName, secondName :
string;
begin
Result := 'Lazy person';
repeat
if not InputQuery('Test program', 'First
name :', firstName)
then Exit;
if not InputQuery('Test program', 'Second name :',
secondName)
then Exit;
until
(firstName <> '') or (secondName <> '');
Result
:= firstName + ' ' + secondName;
end;