ex8.pp 794 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Program Example8;
  2. { Program to demonstrate the GetVideoModeCount function. }
  3. Uses video,keyboard,vidutil;
  4. Procedure DumpMode (M : TVideoMode; Index : Integer);
  5. Var
  6. S : String;
  7. begin
  8. Str(Index:2,S);
  9. inc(Index);
  10. TextOut(1,Index,'Data for mode '+S+': ');
  11. if M.Color then
  12. TextOut(19,Index,' color,')
  13. else
  14. TextOut(19,Index,'No color,');
  15. Str(M.Row:3,S);
  16. TextOut(28,Index,S+' rows');
  17. Str(M.Col:3,S);
  18. TextOut(36,index,S+' columns');
  19. end;
  20. Var
  21. i,Count : Integer;
  22. m : TVideoMode;
  23. begin
  24. InitVideo;
  25. InitKeyboard;
  26. Count:=GetVideoModeCount;
  27. For I:=1 to Count do
  28. begin
  29. GetVideoModeData(I-1,M);
  30. DumpMode(M,I-1);
  31. end;
  32. TextOut(1,Count+1,'Press any key to exit');
  33. UpdateScreen(False);
  34. GetKeyEvent;
  35. DoneKeyboard;
  36. DoneVideo;
  37. end.