POV-Ray : Newsgroups : povray.general : chr(0) problem Server Time
6 Aug 2024 12:23:09 EDT (-0400)
  chr(0) problem (Message 1 to 10 of 24)  
Goto Latest 10 Messages Next 10 Messages >>>
From:
Subject: chr(0) problem
Date: 28 Feb 2002 05:35:57
Message: <5m0s7usm1t32sajav9eou78e4tbfr9f21v@4ax.com>
any idea how to add to string or write into file chr(0) ?
it is the only limit to write binary files :-(

(treat it as feature request if it is not possible)

ABX


Post a reply to this message

From: Grey Knight
Subject: Re: chr(0) problem
Date: 28 Feb 2002 06:10:04
Message: <3C7E1031.F8CEFDE9@namtar.qub.ac.uk>

> 
> any idea how to add to string or write into file chr(0) ?
> it is the only limit to write binary files :-(
> 
> (treat it as feature request if it is not possible)
> 
> ABX

"\0" writes the null character.

-- 
signature{
  "Grey Knight" contact{ email "gre### [at] yahoocom" }
  site_of_week{ url "http://digilander.iol.it/jrgpov" }
}


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: chr(0) problem
Date: 28 Feb 2002 06:14:07
Message: <3c7e10ff@news.povray.org>

Skiba <abx### [at] babilonorg>  wrote:

> any idea how to add to string or write into file chr(0) ?
> it is the only limit to write binary files :-(

As you might know, you are not supposed to be able to write binary files...


    Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From:
Subject: Re: chr(0) problem
Date: 28 Feb 2002 06:27:04
Message: <0n4s7ug2ce25efi7tli2vv7vdpt345ac0g@4ax.com>
On Thu, 28 Feb 2002 12:14:05 +0100, "Thorsten Froehlich" <tho### [at] trfde>
wrote:
> > any idea how to add to string or write into file chr(0) ?
> > it is the only limit to write binary files :-(
>
> As you might know, you are not supposed to be able to write binary files...

Yes, I suppose there wasn't such idea in design of POV. Anyway I wan't try to
write DF3 file and use it within the same parse. It's just the 3d version of
image function and I found it useful in my current task.

ABX


Post a reply to this message

From:
Subject: Re: chr(0) problem
Date: 28 Feb 2002 06:44:45
Message: <0u5s7uoktp549usmnn8sn3q1rtugp730e2@4ax.com>
On Thu, 28 Feb 2002 11:10:41 +0000, Grey Knight <s16### [at] namtarqubacuk>
wrote:
> "\0" writes the null character.

#write(DF3,"\0" <----ERROR
Parse Error: Illegal escape sequence in string.

ABX


Post a reply to this message

From: Grey Knight
Subject: Re: chr(0) problem
Date: 28 Feb 2002 07:03:23
Message: <3C7E1C7D.C4F9EC96@namtar.qub.ac.uk>
Oh dear. What exactly was \0 put in for if you can't write it to a file?
It's not like it makes any sense to put it in a text string...


> 
> On Thu, 28 Feb 2002 11:10:41 +0000, Grey Knight <s16### [at] namtarqubacuk>
> wrote:
> > "\0" writes the null character.
> 
> #write(DF3,"\0" <----ERROR
> Parse Error: Illegal escape sequence in string.
> 
> ABX

-- 
signature{
  "Grey Knight" contact{ email "gre### [at] yahoocom" }
  site_of_week{ url "http://digilander.iol.it/jrgpov" }
}


Post a reply to this message

From:
Subject: Re: chr(0) problem
Date: 28 Feb 2002 07:14:18
Message: <9h7s7uovnvah261sdpgrhgoar29fd73o4m@4ax.com>
On Thu, 28 Feb 2002 12:03:09 +0000, Grey Knight <s16### [at] namtarqubacuk>
wrote:
> Oh dear. What exactly was \0 put in for if you can't write it to a file?
> It's not like it makes any sense to put it in a text string...

From documentation: "Depending on what platform you are using, they may not be
fully supported for console output. However they will appear in any text file
if you re-direct a stream to a file."

When I tried it with #warning it produced the same error message.

So, does it means bug ? Should I repost it into beta-test ?

ABX


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: chr(0) problem
Date: 28 Feb 2002 07:28:43
Message: <3c7e227b@news.povray.org>

Skiba <abx### [at] babilonorg>  wrote:

> From documentation: "Depending on what platform you are using, they may not be
> fully supported for console output. However they will appear in any text file
> if you re-direct a stream to a file."
>
> When I tried it with #warning it produced the same error message.
>
> So, does it means bug ? Should I repost it into beta-test ?

Well, whatever the documentation wants to say with this, a "\0" is converted
to a backslash in at least 3.1 and 3.5.  It is obvious that "\0" cannot be
supported because C strings use it as terminator, so it should probably be
removed from the documentation altogether.

BTW, note that the quote you provided only talks about output streams, not the
file #write directive!

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From:
Subject: Re: chr(0) problem
Date: 28 Feb 2002 07:36:32
Message: <8r8s7u07h0qd6lipk3pfd4ltae7i3pgoai@4ax.com>
On Thu, 28 Feb 2002 13:28:42 +0100, "Thorsten Froehlich" <tho### [at] trfde>
wrote:
> Well, whatever the documentation wants to say with this, a "\0" is converted
> to a backslash in at least 3.1 and 3.5.  It is obvious that "\0" cannot be
> supported because C strings use it as terminator, so it should probably be
> removed from the documentation altogether.

Worse luck!

> BTW, note that the quote you provided only talks about output streams, not the
> file #write directive!

Yes, I noticed. But of course I tested it with #warning before quoting.

The solution I choosed is to limit range to 1-255. I hope it will be
sufficient.

ABX


Post a reply to this message

From: Gleb
Subject: Re: chr(0) problem
Date: 28 Feb 2002 08:57:06
Message: <3c7e3732@news.povray.org>
"Thorsten Froehlich" <tho### [at] trfde> wrote in message
news:3c7e10ff@news.povray.org...

> As you might know, you are not supposed to be able to write binary
files...

By the way, why there is such a limitation? It should be useful.

Gleb


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.