PROG15C.PAS 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. PROGRAM PROG15C;
  2. {$U+ Copyright (C), 1985 by Lyle Faurot. All rights reserved.
  3. New Topics: Screen messages
  4. Editing data entered
  5. }
  6. TYPE
  7. Name_Type = String[12];
  8. VAR
  9. F_Name : String[12];
  10. PROCEDURE Print_Entry_Screen;
  11. BEGIN
  12. ClrScr;
  13. WriteLn(' PERSONAL DATA ENTRY SCREEN');
  14. WriteLn;
  15. WriteLn('First Name:');
  16. WriteLn;
  17. WriteLn(' Last Name:');
  18. WriteLn;
  19. WriteLn(' Phone No:');
  20. END;
  21. FUNCTION OK(String_Entered : Name_Type) : Boolean;
  22. VAR
  23. Response : Char;
  24. BEGIN
  25. GotoXY(1,23);
  26. Write('Is ', String_Entered, ' correct? (Y or N) ');
  27. ReadLn(Response);
  28. IF (Response = 'y') OR (Response = 'Y')
  29. THEN
  30. OK := TRUE
  31. ELSE
  32. OK := FALSE;
  33. END;
  34. PROCEDURE Get_First_Name(VAR First_Name : Name_Type);
  35. BEGIN
  36. REPEAT
  37. GotoXY(13,3);
  38. Read(First_Name);
  39. UNTIL OK(First_Name);
  40. END;
  41. BEGIN
  42. Print_Entry_Screen;
  43. Get_First_Name(F_Name);
  44. END.
  45.