SAMPLE04.MOD 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. (******************************************************************************)
  2. (* SAMPLE04.MOD *)
  3. (* *)
  4. (* metaPort Usage *)
  5. (* Taken from SAMPLE04.PAS - Metagraphics Software Corporation (c) 1987-1989 *)
  6. (* *)
  7. (* PSW 10/31/90 09:07pm *)
  8. (******************************************************************************)
  9. MODULE Sample04;
  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 GrPorts;
  22. IMPORT Meta;
  23. IMPORT IO;
  24. VAR
  25. GrafixCard,
  26. CommPort: INTEGER;
  27. i, j, k: INTEGER;
  28. scrnR: GrConst.rect;
  29. scrnPort,
  30. alertPort: GrPorts.adsPort;
  31. alertPortRcd: GrPorts.metaPort; (* Allocate the port record *)
  32. PROCEDURE Alert();
  33. VAR
  34. entryPort: GrPorts.adsPort;
  35. BEGIN
  36. Meta.GetPort(entryPort);
  37. Meta.SetPort(alertPort);
  38. Meta.SetPort(entryPort)
  39. END Alert;
  40. BEGIN
  41. (* init the system *)
  42. GrQry.GrInit(GrafixCard, CommPort);
  43. i := Meta.InitGrafix(-GrafixCard);
  44. IF (i # 0) THEN
  45. (* Display reason for no go *)
  46. GrQry.GrInitErr(GrafixCard, CommPort, i);
  47. END;
  48. Meta.ScreenRect(scrnR);
  49. Meta.SetDisplay(GrConst.GrafPg0);
  50. Meta.EraseRect(scrnR);
  51. Meta.GetPort(scrnPort);
  52. alertPort := ADR(alertPortRcd);
  53. Meta.InitPort(alertPort);
  54. Alert();
  55. Meta.SetPort(scrnPort);
  56. GrQry.GrQuit('', 0);
  57. END Sample04.