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

  1. /****************************************************************
  2.  
  3.      Turbo Prolog Toolbox
  4.      (C) Copyright 1987 Borland International.
  5.  
  6.         Demo of boxmenu
  7. ****************************************************************/
  8.  
  9. include "tdoms.pro"
  10. include "tpreds.pro"
  11. include "boxmenu.pro"
  12. include "status.pro"
  13.  
  14. PREDICATES
  15.   test
  16.   for(INTEGER,INTEGER,INTEGER)
  17.   str(STRING)
  18.  
  19. CLAUSES
  20.   for(X,X,_).
  21.   for(I,A,B):-B>A,A1=A+1,for(I,A1,B).
  22.  
  23.   str(one).
  24.   str(two).
  25.   str(three).
  26.   str(S):-for(I,4,250),str_int(S,I).
  27.  
  28.   test:-
  29.     findall(X,str(X),L),
  30.     boxmenu(0,0,18,78,7,66,L,"This is a demonstration of boxmenu",0,CHOICE),
  31.     write("Last time you chose the number: ",CHOICE),nl,fail.
  32.  
  33.   test:-
  34.       changestatus("Now choose three numbers, one from each menu"),
  35.     findall(X,str(X),L),
  36.     boxmenu_leave(0,0,10,50,7,32,L,"This is a demonstration of boxmenu_leave",0,CH1),
  37.     boxmenu_leave(4,15,10,50,7,66,L,"This is a demonstration of boxmenu_leave",0,CH2),
  38.     boxmenu_leave(8,40,10,50,7,20,L,"This is a demonstration of boxmenu_leave",0,CH3),
  39.     removewindow,removewindow,removewindow,
  40.     write("Last time you chose the numbers: ",CH1,", ",CH2,", ",CH3),nl,fail.
  41.  
  42.   test:-
  43.     changestatus("Now choose several numbers   F10:End     Cr:Select or remove"),
  44.     findall(X,str(X),L),
  45.     boxmenu_mult(0,0,18,78,7,66,L,"This is a demonstration of boxmenu_mult",[5,10,20],CHOICEL),
  46.     write("Last time you chose the numbers: ",CHOICEL),nl.
  47.  
  48. GOAL
  49.     makewindow(1,23,0,"",0,0,25,80),
  50.     makewindow(1,23,0,"test",20,0,4,80),
  51.     makestatus(112,"Choose a number and press ENTER "),
  52.     test,
  53.     changestatus("End of demonstration").
  54.