POV-Ray : Newsgroups : povray.windows : Output_File_Name -- quoted string question Server Time
28 Mar 2024 06:09:06 EDT (-0400)
  Output_File_Name -- quoted string question (Message 7 to 16 of 16)  
<<< Previous 6 Messages Goto Initial 10 Messages
From: Kenneth
Subject: Re: Output_File_Name -- quoted string question
Date: 12 May 2013 12:30:03
Message: <web.518fc21df34be07c2d977c20@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> On 12-5-2013 14:16, Kenneth wrote:
> In my own povray.ini file, I write these things between quotes:
>
> Output_File_Name = "c:\Documents and Settings\Owner\My
> Documents\POV-Ray\v3.6\tests\"
>

Hey, this works!

I'm embarrassed to say that I tried this earlier...but I didn't run
an actual render to see what would happen!!  :-/  The reason being, that all of
the text in my quickres file that *followed* this line then took on the
appearance of being in string notation--like one *long* string, all the way to
the end of the file. (Rather hard to describe.) So I didn't pursue it, thinking
I had made a mistake.

That behavior is rather odd, to say the least--although it doesn't affect the
operation of the code.

Thanks!


Post a reply to this message

From: Kenneth
Subject: Re: Output_File_Name -- quoted string question
Date: 12 May 2013 12:55:01
Message: <web.518fc73cf34be07c2d977c20@news.povray.org>
Stephen <mca### [at] aolcom> wrote:

>
> Try
>
> Output_File_Name="c:\\Documents and Settings\\Owner\\My
> Documents\\POV-Ray\\v3.6\\tests\\"

This actually works even better; the double slashes eliminate the 'unending
string' behavior that the single slashes produce. Using this particular syntax
never occurred to me, though; the docs don't mention it.

But your suggestion gave me an idea: I'm guessing that the most 'important'
slash is the final one, preceding the last double-quote. My goofy intuition,
anyway, based on something I read in the docs. So I tried it a third way--
single slashes *except* at the end-- and it works as well as using all double
slashes:

Output_File_Name="c:\Documents and Settings\Owner\My
Documents\POV-Ray\v3.6\tests\\"

No error message, and no 'unending strings.'  Great!

Many thanks, to you and to Thomas. Mystery solved!


Post a reply to this message

From: Stephen
Subject: Re: Output_File_Name -- quoted string question
Date: 12 May 2013 13:53:33
Message: <518fd71d$1@news.povray.org>
On 12/05/2013 5:51 PM, Kenneth wrote:
> Output_File_Name="c:\Documents and Settings\Owner\My
> Documents\POV-Ray\v3.6\tests\\"
>
> No error message, and no 'unending strings.'  Great!
>

IIRC it is the spaces in the directory names that cause the trouble. 
There is or was, in a previous version, documented. But not under the 
INI settings.

> Many thanks, to you and to Thomas. Mystery solved!

I am sure that I can speak for Thomas when I say, that it is our 
pleasure to help.

-- 
Regards
     Stephen


Post a reply to this message

From: Alain
Subject: Re: Output_File_Name -- quoted string question
Date: 12 May 2013 20:50:45
Message: <519038e5$1@news.povray.org>

> On 12-5-2013 16:36, Stephen wrote:
>> It also works with "\" instead of "\\" as Thomas posted.
>>
>
> In some cases double back slashes are needed instead of single ones, I
> found out by experience. In particular, when declaring names to be used
> later in the code, like:
>
> #declare Terragen_Sky_Name = "Terragen files\\Skies\\Pano_09_0h_50a_"
>
> Not sure why that is though.
>
> Thomas
>

The back slash is the escape character in strings. For example, "\n" is 
used as a new line character, if you have \Skies\Pano,
it get parsed as "\s" "kies" "\p" "ano"
\s stand for the control character DC3 and \p for DLE


Alain


Post a reply to this message

From: Kenneth
Subject: Re: Output_File_Name -- quoted string question
Date: 12 May 2013 21:50:01
Message: <web.519045c3f34be07c2d977c20@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> Stephen <mca### [at] aolcom> wrote:
>
> >
> > Try
> >
> > Output_File_Name="c:\\Documents and Settings\\Owner\\My
> > Documents\\POV-Ray\\v3.6\\tests\\"
>
> This actually works even better; the double slashes eliminate the 'unending
> string' behavior that the single slashes produce. Using this particular syntax
> never occurred to me, though; the docs don't mention it.
>

Hmm, I see now that the docs do mention something very similar to this (in the
'String Literals' section), but in a different context; it wasn't enough of a
clue for me to expand on it successfully, though.

Strings are mighty strange creatures, IMO, and I'm always learning something new
about their use.

While I was trying to solve my problem, I tried this version of the code as well
(based solely on a sentence in the docs, "if you need to specify a quote mark in
a string literal you must precede it with a backslash")--I just naively added a
slash-and-double-quote at the beginning and end...

\"c:\Documents and Settings\Owner\My Documents\POV-Ray\v3.6\tests\\"

With this version, the 'unending string' appearance cropped up again; but I
proceeded with the render anyway. It did eliminate the original error message--
but the rendered image ended up in the top level of the c: directory!
                 c:\my_image.png

I suppose there's a method to this madness, but it sure is hard to comprehend.
Like a 'black art.' :-O


Post a reply to this message

From: Kenneth
Subject: Re: Output_File_Name -- quoted string question
Date: 12 May 2013 22:20:01
Message: <web.51904c3af34be07c2d977c20@news.povray.org>
BTW, the thing that prompted me to try and solve my original problem was a
subtle difference in behavior between v3.62 and 3.7RC7. In 3.62, the "unquoted
string" error message was benign--just showing up in the message stream, if I
cared to look for it. In 3.7, though, POV-Ray actively switches attention from
the scene file to the quickres.ini file, pointing out the location of the error.

I'm not sure which method of behavior I like better. I suppose 3.7 is doing the
'right thing' by drawing attention to the error; but it can't be so easily
ignored this way, if I *wanted* to ignore it.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Output_File_Name -- quoted string question
Date: 13 May 2013 03:14:36
Message: <519092dc$1@news.povray.org>
On 13-5-2013 2:50, Alain wrote:
> The back slash is the escape character in strings. For example, "\n" is
> used as a new line character, if you have \Skies\Pano,
> it get parsed as "\s" "kies" "\p" "ano"
> \s stand for the control character DC3 and \p for DLE
>

Ah yes, of course. Forgot about the rationale of character strings, 
while using them all the time ;-)

Thomas


Post a reply to this message

From: clipka
Subject: Re: Output_File_Name -- quoted string question
Date: 13 May 2013 14:03:23
Message: <51912aeb$1@news.povray.org>
Am 12.05.2013 18:26, schrieb Kenneth:
> Thomas de Groot <tho### [at] degrootorg> wrote:
>> On 12-5-2013 14:16, Kenneth wrote:
>> In my own povray.ini file, I write these things between quotes:
>>
>> Output_File_Name = "c:\Documents and Settings\Owner\My
>> Documents\POV-Ray\v3.6\tests\"
>>
>
> Hey, this works!
>
> I'm embarrassed to say that I tried this earlier...but I didn't run
> an actual render to see what would happen!!  :-/  The reason being, that all of
> the text in my quickres file that *followed* this line then took on the
> appearance of being in string notation--like one *long* string, all the way to
> the end of the file. (Rather hard to describe.) So I didn't pursue it, thinking
> I had made a mistake.
>
> That behavior is rather odd, to say the least--although it doesn't affect the
> operation of the code.

The reason is the trailing backslash: In POV-Ray's scene description 
language (and many other languages), the backslash serves as an "escape 
character" that changes the meaning of the following character(s); if it 
precedes a double quote, this double quote is taken as part of the 
string rather than the end of it.

This is not the case in INI files, because it would make specifying 
Windows path names a pain.

Or, actually, it would have done so in the past. Nowadays, Windows - and 
most Windows programs, including POV-Ray - also accept Unix-style 
forward slashes in path names. So the following should work perfectly 
fine without messing up the way the rest of the file is shown:

Output_File_Name = "c:/Documents and Settings/Owner/My 
Documents/POV-Ray/v3.6/tests/"

You can also mix both styles.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Output_File_Name -- quoted string question
Date: 14 May 2013 02:48:22
Message: <5191de36$1@news.povray.org>
On 13-5-2013 20:03, clipka wrote:

> Or, actually, it would have done so in the past. Nowadays, Windows - and
> most Windows programs, including POV-Ray - also accept Unix-style
> forward slashes in path names. So the following should work perfectly
> fine without messing up the way the rest of the file is shown:
>
> Output_File_Name = "c:/Documents and Settings/Owner/My
> Documents/POV-Ray/v3.6/tests/"
>
> You can also mix both styles.
>

Good to know. One is never too old to learn new tricks ;-)

Thomas


Post a reply to this message

From: Kenneth
Subject: Re: Output_File_Name -- quoted string question
Date: 14 May 2013 08:20:01
Message: <web.51922a87f34be07c2d977c20@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 12.05.2013 18:26, schrieb Kenneth:

>
> ...Nowadays, Windows - and
> most Windows programs, including POV-Ray - also accept Unix-style
> forward slashes in path names. So the following should work perfectly
> fine without messing up the way the rest of the file is shown:
>
> Output_File_Name = "c:/Documents and Settings/Owner/My
> Documents/POV-Ray/v3.6/tests/"
>

Hmm. My results with this in Windows XP are interesting and weird: It *does*
eliminate the 'unending string quote' appearance in the INI file; but it
produces a fatal error, "File Init Error: Cannot open output file."

(I double-checked to see if I had made any errors with my syntax.)

Perhaps it works with *later* Windows editions(?)


Post a reply to this message

<<< Previous 6 Messages Goto Initial 10 Messages

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