From dd31b28cf8e744f9b32be4c379dfc348f7da563d Mon Sep 17 00:00:00 2001 From: vsc Date: Mon, 19 Nov 2001 23:20:52 +0000 Subject: [PATCH] changed phones.pl git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@190 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- LGPL/pillow/examples/phones.yap | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 LGPL/pillow/examples/phones.yap diff --git a/LGPL/pillow/examples/phones.yap b/LGPL/pillow/examples/phones.yap new file mode 100644 index 000000000..7e74e092b --- /dev/null +++ b/LGPL/pillow/examples/phones.yap @@ -0,0 +1,31 @@ +:- ensure_loaded(library(pillow)). + +main :- + get_form_input(Input), + get_form_value(Input,person_name,Name), + response(Name,Response), + output_html([ + cgi_reply, + start, + title('Telephone database'), + heading(2,'Telephone database'), + --, + Response, + start_form, + 'Click here, enter name of clip member, and press Return:', + \\, + input(text,[name=person_name,size=20]), + end_form, + end]). + +response(Name, Response) :- + form_empty_value(Name) -> + Response = [] + ; phone(Name, Phone) -> + Response = ['Telephone number of ',b(Name),': ',Phone,$] + ; Response = ['No telephone number available for ',b(Name),'.',$]. + +phone(daniel, '336-7448'). +phone(manuel, '336-7435'). +phone(sacha, '543-5316'). +