POV-Ray : Newsgroups : povray.bugreports : #debug concat truncating text? Server Time: 18 Jan 2019 01:58:59 GMT
  #debug concat truncating text? (Message 1 to 4 of 4)  
From: dick balaska
Subject: #debug concat truncating text?
Date: 13 Sep 2018 08:37:16
Message: <5b9a21bc$1@news.povray.org>
I am passing some debug text from java to SDL via a declare.  Tonight I
added more than two lines of text to the concat/declare and the result
is truncated.

The doc says each individual string literal is max 256 chars. I see no
limit on the concat.
Regardless, this one is tipping over at the 156 character mark.

In the following, the #debug "======\n" line is not part of the
questioned text, and occurs later in processing and is used to
demonstrate the missing \n from the questioned text.

SDL:

#declare ThrustDebugText=concat("Using file
/pov/tteo2015/data/ttlo/thrust/23.976/_th-1045.inc\n    for clock =
93.05800000001197\n",
"    updateLocoPosition MecoStart vel=decel\n",
"    updateLocoPosition MecoStart vel=decel\n",
"    updateLocoPosition MecoStart vel=decel\n",
"    updateLocoPosition MecoStart vel=decel\n",
"    SpaceLocoVec=<110.00, 381.85, 20.00> CabooseVec=<110.00, 368.35,
20.00>\n"
);

output:

Using file /pov/tteo2015/data/ttlo/thrust/23.976/_th-1045.inc
    for clock = 93.05800000001197
    updateLocoPosition MecoStart vel=decel
    updateLocoPos...============================


The shorter (two line) #concat works as expected.

SDL:

#declare ThrustDebugText=concat("Using file
/pov/tteo2015/data/ttlo/thrust/23.976/_th-1001.inc\n    for clock =
91.21800000001103\n",
"    SpaceLocoVec=<110.00, 355.74, 20.00> CabooseVec=<110.00, 342.24,
20.00>\n"
);

output:

Using file /pov/tteo2015/data/ttlo/thrust/23.976/_th-1001.inc
    for clock = 91.21800000001103
    SpaceLocoVec=<110.00, 355.74, 20.00> CabooseVec=<110.00, 342.24, 20.00>
============================

-- 
dik
Rendered 1024 of 921600 pixels (0%)


Post a reply to this message

From: clipka
Subject: Re: #debug concat truncating text?
Date: 13 Sep 2018 12:11:45
Message: <5b9a5401$1@news.povray.org>
Am 13.09.2018 um 10:37 schrieb dick balaska:
> I am passing some debug text from java to SDL via a declare.  Tonight I
> added more than two lines of text to the concat/declare and the result
> is truncated.
> 
> The doc says each individual string literal is max 256 chars. I see no
> limit on the concat.
> Regardless, this one is tipping over at the 156 character mark.

Debug output is limited to 200 characters per `#debug` directive; if
that limit is exceeded, the message is truncated to 156 characters and
"..." appended to indicate the deed.

Note that you can construct longer debug output lines by chaining
`#debug` directives rather than using `concat`.

(Don't ask me about the rationale; I'm just a messenger of
implementation facts here.)


Post a reply to this message

From: clipka
Subject: Re: #debug concat truncating text?
Date: 13 Sep 2018 12:40:30
Message: <5b9a5abe@news.povray.org>
Am 13.09.2018 um 14:11 schrieb clipka:

> Debug output is limited to 200 characters per `#debug` directive; if
> that limit is exceeded, the message is truncated to 156 characters and
> "..." appended to indicate the deed.
...
> (Don't ask me about the rationale; I'm just a messenger of
> implementation facts here.)

BTW, this limit seems to have originally been introduced with v3.5.0,
where the numbers were 160 and 124 characters, respectively; in v3.6.0
it was changed to the current values.

There is /some/ rationale to such behaviour, because other downstream
code cannot cope with arbitrarily large strings. The limit there is (and
seems to have always been) 1023 characters though. Also, that bottleneck
could be circumvented.

Also, the limit might come in handy to prevent you from shooting
yourself in the foot with excessively long debug messages that would
take ages to display; though I think POV-Ray users don't need such
babysitting, and besides there are plenty of other sharp objects
scattered around in POV-Ray to hurt oneself with.


Post a reply to this message

From: dick balaska
Subject: Re: #debug concat truncating text?
Date: 13 Sep 2018 13:38:00
Message: <5b9a6838$1@news.povray.org>
On 09/13/2018 08:11 AM, clipka wrote:


> 
> Note that you can construct longer debug output lines by chaining
> `#debug` directives rather than using `concat`.

At first I was irked I didn't think of this.  But it's a little bit
trickier, because I am doing
 `#declare DebugString=concat("foo", "bar");`

I guess I can pass an array of strings.

> 
> (Don't ask me about the rationale; I'm just a messenger of
> implementation facts here.)

Even twitter has 280 now. ;)


-- 
dik
Rendered 1024 of 921600 pixels (0%)


Post a reply to this message

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