Presence Check

A check is made that the value of a required input has been entered:

program PresenceCheck;
{$APPTYPE CONSOLE}
uses
  SysUtils;
var
  Surname : string;
begin
  repeat
    write('Please enter your surname. ');
    readln(Surname);
  until length(Surname) > 0; //Alternatively, until Surname <>'';
  writeln(Surname, ' has passed the presence check.');
  readln;
end.

Programming - a skill for life!

Checking data to see if it is sensible