home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l216 / 2.ddi / XLINEINP.PRO < prev    next >
Encoding:
Text File  |  1987-03-23  |  1.5 KB  |  61 lines

  1. /****************************************************************
  2.  
  3.      Turbo Prolog Toolbox
  4.      (C) Copyright 1987 Borland International.
  5.  
  6.         Demo of    lineinput utility
  7. ****************************************************************/
  8.  
  9. include "tdoms.pro"
  10.  
  11. DATABASE
  12.   insmode
  13.   lineinpstate(STRING,COL)
  14.   lineinpflag
  15.  
  16. CLAUSES
  17.   insmode.
  18.  
  19. include "tpreds.pro"
  20. include "lineinp.pro"
  21. include "status.pro"
  22.  
  23. PREDICATES
  24.   test
  25.  
  26. CLAUSES
  27.   test:-
  28.     lineinput(10,10,45,23,66,"Which computer do you have: ","IBM PC",TXT),
  29.     write("Resulting text input: ",TXT),nl,fail.
  30.  
  31.   test:-
  32.     changestatus(" Modify each of the three texts, pressing Cr after each"),
  33.     lineinput_leave(7,10,40,23,71,"Text1: ","this is old text 1",TXT1),
  34.     lineinput_leave(11,10,40,23,71,"Text2: ","this is old text 2",TXT2),
  35.     lineinput_leave(15,10,40,23,71,"Text3: ","this is old text 3",TXT3),
  36.     removewindow,removewindow,removewindow,
  37.     write("TEXT1= ",TXT1),nl,
  38.     write("TEXT2= ",TXT2),nl,
  39.     write("TEXT3= ",TXT3),nl,
  40.     fail.
  41.  
  42.   test:-
  43.     changestatus("Press the space bar for a demo of lineinput_repeat"),
  44.     readkey(_),
  45.     clearwindow,
  46.     changestatus(" Lineinput_repeat requests for new lines until the Esc key is pressed."),
  47.     lineinput_repeat(7,10,40,23,71,"Text: ","",TXT),
  48.     shiftwindow(OLD),
  49.     shiftwindow(2),
  50.     write("TEXT= ",TXT),nl,
  51.     shiftwindow(OLD),
  52.     fail.
  53.  
  54.   test.
  55.  
  56. GOAL
  57.     makewindow(2,32,0,"",0,0,24,80),
  58.     makestatus(112," Input some new text or amend the old"),
  59.     test,
  60.     changestatus("End of demo").
  61.