home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l217 / 2.ddi / EXAMPLES / CH18EX01.PRO < prev    next >
Encoding:
Text File  |  1990-03-26  |  1.1 KB  |  44 lines

  1. /*
  2.    Copyright (c) 1986, 90 by Prolog Development Center
  3. */
  4. constants
  5. % To access your BGI drivers and fonts bgi_path may need to equal "..\\BGI".
  6.    bgi_path = ""
  7.  
  8.  
  9. % To access the GRAPDECL.PRO file you may need to add a path: 
  10. % include "..\\programs\\GRAPDECL.PRO" 
  11. include "GRAPDECL.PRO" 
  12.  
  13. predicates
  14.    toText
  15.    tempTextmode
  16.    toGraphic
  17.  
  18. goal
  19.    toGraphic,
  20.    tempTextmode,
  21.    toText.
  22.  
  23. clauses
  24.    toGraphic:-
  25.       % Detect graphics hardware
  26.       detectGraph(G_Driver, G_Mode),
  27.       initGraph(G_Driver,G_Mode, New_Driver,New_Mode, bgi_path),
  28.       write("A look into the BGI"),nl,
  29.       writef("Graph_Driver = %, Graph_Mode = %",G_Driver,G_Mode),nl,
  30.       writef("Newe_Driver = %, New_Mode = %",New_Driver,New_Mode),nl,    
  31.       write("Press key to return:"),
  32.       readchar(_).
  33.  
  34.   TempTextmode:-
  35.       getGraphMode(GraphMode),
  36.       restoreCRTMode,
  37.       write("\nNow you are in text mode.\n\n"),
  38.       write("\nPress any key to go back to graphics ..."),
  39.       readchar(_),
  40.       setGraphMode(GraphMode).
  41.  
  42.    ToText:-
  43.       closegraph().
  44.