Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > IT форум > Помощь студентам
Регистрация

Восстановить пароль

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 11.05.2013, 15:57   #1
dengul
Пользователь
 
Регистрация: 11.11.2010
Сообщений: 17
По умолчанию ТУРБО ПРОЛОГ! нужен совет....

Доброго времени суток!

пишу простую БД на turbo prolog 2. складской учёт

суть в одной ошибке из-за которой я собственно и не могу закончить программу, я её переписывал уже 4 раза (разные алгоритмы), и опять выскакивает та же ошибка "703 This flow pattern doesn't exist. (Look in the message window)"

текст программы ниже

Код:
domains
name,unit,cena,total,date,type=string 
file=f

database
   dsklad (name,unit,cena,total,date,type) 

predicates
   menu                      
   reaction(char)                                       
   findtype(char)
   find_name(name,unit,cena,total,date,type)
   find_date(name,unit,cena,total,date,type)
   find(char)                          
   start 	
 
clauses
	find_name(name,unit,cena,total,date,type):-
							dsklad (name,unit,cena,total,date,type),!.
	find_name(_,"Error! Record not found...",_,_,_,_).
	
	find_date(name,unit,cena,total,date,type):-
							dsklad (name,unit,cena,total,date,type),!.
	find_date("Error! Record not found...",_,_,_,_,_).
	
	findtype(N):- 
									clearwindow,
									write("1 - Poisk po naimenovaniy tovara"),nl,
									write("2 - Poisk po date "),nl,
									write("3 - Vernutsja na glavnoe menu"),nl,
									readchar(N).
				
					find('1'):-		
									clearwindow,
									Write("Enter the name of the goods: "),nl,
									readln(name),
									find_name(name,unit,cena,total,date,type),
									Write(name,unit,cena,total,date,type),
									readchar(_),menu.
					
					find('2'):-     
									clearwindow,
									write("Enter the desired date: "),nl,
									readln(date),
									find_date(name,unit,cena,total,date,type),
									Write(name,unit,cena,total,date,type),
									readchar(_),menu.
	
					find('3'):-     menu.
					
    menu:- 
				clearwindow,
                write("1-  Add record "),nl,
                write("2-  Delete record "),nl,
                write("3-  Find the entry "),nl, 
                write("4-  Change the record "),nl,
			/*	write("5-  Stocktaking "),nl,  */
                write("0-  Exit"), nl, 
				readchar(N), reaction(N).

	reaction('1'):-   
					clearwindow,
					write("Enter the name of the goods: "),nl,
	ругается тут----------	readln(name),
					write("Unit of measurement: "),nl,
					readln(unit),
					write("The price for one unit of: "),nl,
					readln(cena),
					write("Quantity of goods: "),nl,
					readln(total),
					write("Date: "),nl,
					readln(date),
					write("parish or loss?: "),nl,
					readln(type),
					assert(dsklad(name,unit,cena,total,date,type)), 
					write("Accepted record"),menu.
  
	reaction('2'):-
					clearwindow,
					write("Specify the name of the deleted product: "),nl,
					readln(name),
					retract(dsklad(name,_,_,_,_,_)),
					menu.
	
	reaction('3'):-
					clearwindow,
					findtype(N),find(N),menu.
	
					
   
    reaction('4'):-
					clearwindow,
					write(" |_Enter the new information_| "),nl,
					write("Enter the name of the goods: "), nl,
					readln(name),
					write("Unit of measurement: "),nl,
					readln(unit),
					write("The price for one unit of: "),nl,
					readln(cena),
					write("Quantity of goods: "),nl,
					readln(total),
					write("Date: "),nl,
					readln(date),
					write("Parish or Loss?: "),nl,
					readln(type),
					retract(dsklad(name,_,_,_,_,_)),
					assert(dsklad(name,unit,cena,total,date,type)), 
					write("Accepted record"),menu.
	
/*	reaction('5'):-  */	
					
	reaction('0'):- 
					save("sklad.ddb"),
					retractall(_).
	
	reaction(_)  :-
					menu.
	
	start:-
					existfile("sklad.ddb"),!, 
					consult("sklad.ddb "), 
					menu. 
	start:-
					openwrite(f,"sklad.ddb"),      
					closefile(f),
					menu. 
	
  goal

   makewindow(1, 10, 3, "_DATA BASE SKLAD_ ", 3, 10, 19, 60, 1, -1,
                          "\218\191\192\217\196\179"), start.
dengul вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Нужен специалист по Лиспу и Пролог Nasty1111 Фриланс 2 17.02.2013 14:17
Работа с файлами (Турбо Пролог) К.Марат Помощь студентам 0 26.04.2012 19:40
Нужен программист на пролог. Virus191288 Фриланс 5 14.02.2012 13:44
Нужен совет, просто совет kardinal94 Общие вопросы Delphi 7 16.12.2010 22:16
Подскажите пожалуйста. "турбо-Пролог" Dentin Помощь студентам 1 30.05.2009 15:34