put_code

[email protected]
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <[email protected]>
I am trying to automatically generate PPM P5 files.
In order to write the binary part of the files, I am using

put_code/1

It says that accepts non negative integer numbers. My aim is to
produce greyscale images so I need to write numbers that represent
the grey level. Of course, numbers go from 0 to 255.
That's the problem.

        put_code(1)
up to
        put_code(255)
work;

but

        put_code(0)

does not.

I get

ERROR:Exception error(representation_error(character_code),put_code/1)  
occurred while evaluating the query " put_code(0) ".

Please, give me a suggestion or an alternative solution for this problem.

Thanks in advance

----------------------------------------------------------------
Massimo De Gregorio
Research Scientist
Istituto di Cibernetica "Eduardo Caianiello" - CNR
Via Campi Flegrei 34
Comprensorio "A. Olivetti" - Ed. 70
80078 Pozzuoli (NA) - ITALIA
Tel. (+ 39) 0818675151
Fax: (+ 39) 0818675158
Skype: massimo.de.gregorio
E-mail: [email protected]
----------------------------------------------------------------

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.