Ошибка: "Free variable in expression" - Prolog
Формулировка задачи:
Друзья, помогите побороть эту ошибку: "Free varable in expression" в выражении scan(V,Q):-V<=Q,
Листинг программы
- nowarnings
- domains
- q = string
- n = integer
- predicates
- payroll (n,q,n,n,q,n)
- data_bank
- scan(n,n)
- process(n)
- repeat
- do_mbase
- menu
- error
- goal
- do_mbase.
- clauses
- payroll (1,"24.01.2016",6,60,"mostly cloudy",754).
- payroll (2,"25.01.2016",2,75,"snow to rain",764).
- payroll (3,"26.01.2016",0,60,"partly cloudy",754).
- repeat.
- repeat:-repeat.
- do_mbase:-makewindow(1,7,7,"Menu",0,0,25,80),menu.
- menu:-repeat, clearwindow,
- write("Select the menu item: "), nl, nl,
- write("1. View the database"), nl ,
- write("2. Пошук запису по прізвищу працівника"), nl,
- write("3. Знайти всіх робітників чий оклад не перевищуЇ суму, що вводиться"), nl,
- write("0. Exit"), nl ,
- write("********"), nl, nl ,
- write("Enter the menu item"), nl ,
- readint(X),nl,
- process(X),X=0,!.
- process (1):-
- makewindow (2,7,7,"The database",2,20,18,58),clearwindow,
- write ("Database : "),
- cursor (3,14),data_bank,nl,nl,
- write("Press any key"),readchar(_),fail.
- process (2):-
- makewindow(3,14,14,"Пошук",0,0,20,40),
- write("Search by description of the weather: "),
- write("Enter description "), readln(Z),
- payroll(X,Y,V,B,Z,C), cursor(7,14),
- write("Number - ",X),nl,
- write("Date - ",Y),nl,
- write("Temperature - ",V),nl,
- write("Humidity - ",B),nl,
- write("Description - ",Z),
- write("Pressure - ",C),nl,nl,nl, % Атм. тиск
- write("Press any key"),readchar(_),
- removewindow.
- /* Перегляд інформації з БД */
- process (3):-makewindow (4,7,7,"Window 3",0,0,24,70),
- write ("The temperature is below of: "),
- write ("Еnter temperature"), readint(Q),
- payroll(_,_,_,_,_,_),
- scan(V,Q).
- /* Вихід з діалогу */
- process (0):-
- write("Press any key"),
- readchar(_),exit.
- process (X):-X<0,error,
- X>3,error.
- error:- write ("The number must be 0-3"),nl,nl,
- write ("Press any key"),readchar(_).
- data_bank:-
- payroll(X,Y,V,B,Z,C),nl,
- write("Number - ",X),nl,
- write("Date - ",Y),nl,
- write("Temperature - ",V),nl,
- write("Humidity - ",B),nl,
- write("Description - ",Z),
- write("Pressure - ",C),nl,nl,
- write("Press any key"), readchar(_),nl,fail.
- data_bank :- !.
- scan(V,Q):-V<=Q,
- write("Number - ",X),nl,
- write("Date - ",Y),nl,
- write("Temperature - ",V),nl,
- write("Humidity - ",B),nl,
- write("Description - ",Z),
- write("Pressure - ",C),nl,nl,
- write("Press any key"), readchar(_),nl,fail.
- scan(V,Q):-!.
Решение задачи: «Ошибка: "Free variable in expression"»
textual
Листинг программы
- write ("Еnter temperature"), readint(Q),
- payroll(_,_,_,_,_,_),
- scan(V,Q).
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д