Subject: RE: Help

From: "Douglas Miles (Volt Computer)" <[email-masked]>
Date: Fri, 6 Oct 2000 12:22:31 -0700

file_bytes(Src,ByteList):-!,
	open(Src, read, Stream),
	file_bytes1(Stream,ByteList),
	close(Stream).

file_bytes1(Stream,[]):- at_end_of_stream(Stream),!.

file_bytes1(Stream,[Byte|ByteList]):-
	get_byte(Stream,Char),
	file_bytes1(Stream,ByteList).

?-file_bytes('myhtml.html',Bytes).

Then from there you should be able to parse the bytes.

-Douglas

> -----Original Message-----
> From: Oliver [mailto:[email-masked]]
> Sent: Tuesday, October 03, 2000 12:30 AM
> To: Douglas Miles (Volt Computer)
> Subject: RE: Help
> 
> 
> Hi Douglas,
> thanks for your e-mail. First I wanted to read from a text file just
> characters and show them on screen. But it doesn't work 
> because I got the
> error message "unexpected end of file" or something like that. But the
> main task is that I should have a HTML formular where I can check some
> checkboxes so that the Prolog program can use this values. So 
> I thought
> that it would be the easiest to write with html in a file and then to
> read the file with prolog. I don't know if it is the best (or 
> easiest) way
> to do so. I also found the pillow package from CIAO which use html and
> prolog over a CGI. But the problem is that it doesn't work on 
> SWI Prolog
> and I have to use SWI Prolog. Maybe you can give me a tip how 
> I can solve
> my problem best.
> Thank you very much.
> Oliver
> 
> On Mon, 2 Oct 2000, Douglas Miles (Volt Computer) wrote:
> 
> > 
> > 
> > > -----Original Message-----
> > > From: Douglas Miles (Volt Computer) 
> > > Sent: Monday, October 02, 2000 3:07 PM
> > > To: 'Oliver'; Prolog
> > > Subject: RE: Help
> > > 
> > > 
> > > Oliver,
> > > 
> > > This text file,
> > > 
> > > Does each prolog clause end with a period?
> > > 
> > > Or is it just alphanumeric text in non-prolog clause form? .. 
> > > if so.. Are you trying to read it in as prolog terms or are 
> > > you trying charicter by charicter?
> > > 
> > > -Douglas
> > > 
> > > > -----Original Message-----
> > > > From: Oliver [mailto:[email-masked]]
> > > > Sent: Monday, October 02, 2000 11:22 AM
> > > > To: Prolog
> > > > Subject: Help
> > > > 
> > > > 
> > > > hi,
> > > > we have to read from a text file...
> > > > but we always get the following error message:
> > > >      Syntax error: Unexpected end of file
> > > > Do we have to put a special Character in the file?
> > > > Hope somebody can help us...
> > > > thanks a lot
> > > > oliver
> > > > 
> > > > 
> > > > ----------------
> > > > * To UNSUBSCRIBE, please use the HTML form at
> > > > 
> > > >     
> > > > 
http://www.swi.psy.uva.nl/projects/SWI-Prolog/index.html#mailinglist
> > > 
> > > or send mail to [email-masked] using the 
> > > Subject: "unsubscribe"
> > > (without the quotes) and *no* message body.
> > > 
> > > ** An ARCHIVE of this list is maintained at
> > > 
> > >     
> > http://www.swi.psy.uva.nl/projects/SWI-Prolog/mailinglist/archive/
> > > 
> > 
>