ex6.pp 654 B

12345678910111213141516171819202122232425262728293031323334
  1. Program Example6;
  2. { Program to demonstrate the GetLockScreenCount function. }
  3. Uses video,keyboard,vidutil;
  4. Var
  5. I : Longint;
  6. S : String;
  7. begin
  8. InitVideo;
  9. InitKeyboard;
  10. TextOut(1,1,'Press key till new text appears.');
  11. UpdateScreen(False);
  12. Randomize;
  13. For I:=0 to Random(10)+1 do
  14. LockScreenUpdate;
  15. I:=0;
  16. While GetLockScreenCount<>0 do
  17. begin
  18. Inc(I);
  19. Str(I,S);
  20. UnlockScreenUpdate;
  21. GetKeyEvent;
  22. TextOut(1,1,'UnLockScreenUpdate had to be called '+S+' times');
  23. UpdateScreen(False);
  24. end;
  25. TextOut(1,2,'Press any key to end.');
  26. UpdateScreen(False);
  27. GetKeyEvent;
  28. DoneKeyboard;
  29. DoneVideo;
  30. end.