SAMPLE01.MOD 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. (******************************************************************************)
  2. (* SAMPLE01.MOD *)
  3. (* *)
  4. (* MoveTo/LineTo Example *)
  5. (* Taken from SAMPLE01.PAS - Metagraphics Software Corporation (c) 1987-1989 *)
  6. (* *)
  7. (* PSW 10/31/90 07:42pm *)
  8. (******************************************************************************)
  9. MODULE Sample01;
  10. (*
  11. * Graphix
  12. * Release 3.7
  13. * (c) Copyright 1986-1992 PMI
  14. * Green Bay, Wisconsin
  15. * (414) 468-6040
  16. * All rights reserved
  17. *
  18. *)
  19. IMPORT GrQry;
  20. IMPORT GrConst;
  21. IMPORT Meta;
  22. IMPORT IO;
  23. VAR
  24. GrafixCard,
  25. CommPort,
  26. i: INTEGER;
  27. ch: CHAR;
  28. sR: GrConst.rect;
  29. BEGIN
  30. (* init the system *)
  31. GrQry.GrInit(GrafixCard, CommPort);
  32. i := Meta.InitGrafix(-GrafixCard);
  33. IF (i # 0) THEN
  34. (* Display reason for no go *)
  35. GrQry.GrInitErr(GrafixCard, CommPort, i);
  36. END;
  37. Meta.SetDisplay(GrConst.GrafPg0); (* Switch to graphics page 0 *)
  38. Meta.ScreenRect(sR); (* Get the screen limits *)
  39. Meta.EraseRect(sR); (* Erase the screen *)
  40. Meta.FrameRect(sR);
  41. Meta.MoveTo(sR.Xmin, sR.Ymin); (* Draw a full screen x *)
  42. Meta.LineTo(sR.Xmax, sR.Ymax);
  43. Meta.MoveTo(sR.Xmin, sR.Ymax);
  44. Meta.LineTo(sR.Xmax, sR.Ymin);
  45. Meta.MoveTo(sR.Xmin+10, sR.Ymax DIV 2);
  46. Meta.DrawString('This is a line of text');
  47. ch := IO.RdChar(); (* Wait for a keypress *)
  48. GrQry.GrQuit('', 0);
  49. END Sample01.