POV-Ray : Newsgroups : povray.windows : Output_File_Name -- quoted string question Server Time: 1 Oct 2020 02:42:07 GMT
  Output_File_Name -- quoted string question (Message 11 to 16 of 16)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Kenneth
Subject: Re: Output_File_Name -- quoted string question
Date: 13 May 2013 01: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: 13 May 2013 02: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 07: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 18: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 06: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 12: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 10 Messages Goto Initial 10 Messages

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