POV-Ray : Newsgroups : povray.general : Illegal escape sequence in string? Server Time
1 Nov 2024 03:15:37 EDT (-0400)
  Illegal escape sequence in string? (Message 1 to 10 of 20)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Sven Littkowski
Subject: Illegal escape sequence in string?
Date: 3 Dec 2017 20:57:10
Message: <5a24ab76$1@news.povray.org>
What in this code causes the parse error
"Illegal escape sequence in string"?
----------------------

#declare MyGrassTexture = texture
{
 pigment { color rgb < 0.35, 0.65, 0.0 >*0.9 }
 normal { bumps 0.75 scale 0.015 }
 finish { phong 0.1 }
}

#declare MySandTexture = texture
{
 pigment { color rgb < 0.5098039,  0.3137255,  0.2156863 > }
 normal { granite 0.1 scale 10.0 }
}

height_field
{
 png "C:\Users\Sven Littkowski\Downloads\Images\POV-Ray Textures\SL -
Cloud Cities - Habitat - Heightfield.png" // the string is in one line
 smooth
 pigment { White }
 translate < -0.5, -0.5, -0.5 >
 scale < 38.0, 1.75, 38.0 >
 texture
 {
  gradient y
  texture_map
  {
   [ 0.000 MyGrassTexture ]
   [ 0.200 MySandTexture  ]
   [ 0.300 MyGrassTexture ]
   [ 0.400 MySandTexture  ]
   [ 0.500 MyGrassTexture ]
   [ 1.000 MySandTexture  ]
  }
 }
 translate < 0.0, -1.1999999999, 0.0 >
}

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

From: Bald Eagle
Subject: Re: Illegal escape sequence in string?
Date: 3 Dec 2017 21:25:01
Message: <web.5a24b1ead18938585cafe28e0@news.povray.org>
use forward slashes for filenames.

png "C:/Users/Sven Littkowski/Downloads/Images/POV-Ray Textures/SL - Cloud
Cities - Habitat - Heightfield.png" // the string is in one line

I'd also strongly advise using more parser-friendly filenames - the dashes and
spaces seem a bit iffy to me.

#usingContiguousCamelCaseFilenamesIsPreferable


Post a reply to this message

From: Sven Littkowski
Subject: Re: Illegal escape sequence in string?
Date: 4 Dec 2017 00:18:09
Message: <5a24da91$1@news.povray.org>
On 03.12.2017 21:24, Bald Eagle wrote:
> use forward slashes for filenames.
> I'd also strongly advise using more parser-friendly filenames - the dashe
s and
> spaces seem a bit iffy to me.

Yes, your suggestion that slashes must be forward did actually solve my
little problem. Isn't it strange - I use POV-Ray since around 1989 or
1992, but nevertimes really much, and so I have still today all these
little problems and misunderstandings. After 28 years...

FILE NAMES
They all actually follow certain rules that I use all over my computers.
I make a difference between "connected-word" and "different - items".
But that wasn't the problem, fortunately. :-)

Big thanks!

PS: I am posting another problem in a new thread: how to create a
cylinder where one of the two round sides has the shape of a height_field.

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

From: clipka
Subject: Re: Illegal escape sequence in string?
Date: 4 Dec 2017 01:34:05
Message: <5a24ec5d$1@news.povray.org>
Am 04.12.2017 um 06:17 schrieb Sven Littkowski:
> On 03.12.2017 21:24, Bald Eagle wrote:
>> use forward slashes for filenames.
>> I'd also strongly advise using more parser-friendly filenames - the dashes and
>> spaces seem a bit iffy to me.
> 
> Yes, your suggestion that slashes must be forward did actually solve my
> little problem. Isn't it strange - I use POV-Ray since around 1989 or
> 1992, but nevertimes really much, and so I have still today all these
> little problems and misunderstandings. After 28 years...

As a matter of fact, POV-Ray for Windows can deal with both notations --
backslashes or forward slashes -- but the backslash happens to have a
special meaning in POV-Ray string literals, in that it changes the
meaning of the next character(s); for example:

    \n    new line
    \t    tab character
    \"    double quote character
    \\    backslash character

This is referred to as "escape sequences". There are more, but these are
the ones I recall off the top of my head.


The reason you never encountered this before might be because in version
v3.6 and earlier there were /some/ (poorly documented) cases where the
backslash character wasn't given any special treatment (except for
constituting a path separator character in Windows), and yours would
have been one of them.


Post a reply to this message

From: Kenneth
Subject: Re: Illegal escape sequence in string?
Date: 4 Dec 2017 03:30:01
Message: <web.5a250736d189385889df8d30@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> use forward slashes for filenames.
>
> png "C:/Users/Sven Littkowski/Downloads/Images/POV-Ray Textures/SL - Cloud
> Cities - Habitat - Heightfield.png" // the string is in one line
>

But it's interesing that Windows itself uses back slashes for file locations.

Point taken, though.

I'm guilty of still using back slashes in my pov.ini file, and in quickres.ini.
I guess I should change that. But if I change the following to forward
slashes...

Output_File_Name="C:\Users\Computer\Documents\Kens POV-Ray rendered IMAGES\"

.... will Windows itself still recognize that as a valid location? I've never
tried it (due to the 'fear factor', ha.)


Post a reply to this message

From: dick balaska
Subject: Re: Illegal escape sequence in string?
Date: 4 Dec 2017 03:30:31
Message: <5a2507a7$1@news.povray.org>
On 12/03/2017 09:24 PM, Bald Eagle wrote:

> I'd also strongly advise using more parser-friendly filenames - the dashes and
> spaces seem a bit iffy to me.
> 
> #usingContiguousCamelCaseFilenamesIsPreferable
> 

Spaces in file names are evil.

A filename is a single word.

I would think especially a native German speaker would gravitate more 
towards Bezirksschornsteinfegermeister than "district chimney sweep 
master". ;)


Post a reply to this message

From: Kenneth
Subject: Re: Illegal escape sequence in string?
Date: 4 Dec 2017 05:05:01
Message: <web.5a251d42d189385889df8d30@news.povray.org>
dick balaska <dic### [at] buckosoftcom> wrote:
> On 12/03/2017 09:24 PM, Bald Eagle wrote:
>
> > I'd also strongly advise using more parser-friendly filenames - the dashes and
> > spaces seem a bit iffy to me.
> >
> > #usingContiguousCamelCaseFilenamesIsPreferable
> >
> Spaces in file names are evil.

Hmm, wasn't it Albert Einstein in 1905 who thought up the idea of using 'bottom
slashes' instead of spaces?? ;-P  (Sorry, I don't know what they are called)...

using_Contiguous_Camel_Case_Filenames_Is_Preferable

I still do that-- uh, from time to time...

Now, if I only knew what 'Camel Case filename' means... :-?
>
> A filename is a single word.
>
> I would think especially a native German speaker would gravitate more
> towards Bezirksschornsteinfegermeister than "district chimney sweep
> master". ;)

Yes, German does seem to be more compact (???)


Post a reply to this message

From: Stephen
Subject: Re: Illegal escape sequence in string?
Date: 4 Dec 2017 06:14:49
Message: <5a252e29$1@news.povray.org>
On 04/12/2017 10:02, Kenneth wrote:
> dick balaska <dic### [at] buckosoftcom> wrote:
>> On 12/03/2017 09:24 PM, Bald Eagle wrote:
>>
>>> I'd also strongly advise using more parser-friendly filenames - the dashes and
>>> spaces seem a bit iffy to me.
>>>
>>> #usingContiguousCamelCaseFilenamesIsPreferable
>>>
>> Spaces in file names are evil.
>
> Hmm, wasn't it Albert Einstein in 1905 who thought up the idea of using 'bottom
> slashes' instead of spaces?? ;-P  (Sorry, I don't know what they are called)...
>

FYI Underscore.




-- 

Regards
     Stephen


Post a reply to this message

From: Bald Eagle
Subject: Re: Illegal escape sequence in string?
Date: 4 Dec 2017 06:25:00
Message: <web.5a253075d18938585cafe28e0@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

> Hmm, wasn't it Albert Einstein in 1905 who thought up the idea of using 'bottom
> slashes' instead of spaces?? ;-P  (Sorry, I don't know what they are called)...

Underscores.


> Now, if I only knew what 'Camel Case filename' means... :-?

https://en.wikipedia.org/wiki/Camel_case

> > A filename is a single word.

It is, however the screen display of ASCII(32) (IIRC) has no special meaning
unless we attribute it one.   So from a purely technical perspective, when the
filename is _inside quotes_ then it's kind of easy to see what's going on.

However, the obvious problem, and why I try to avoid spaces and underscores, is
that it's hard to deal with leading, trailing, and multiples characters like
that.

> > I would think especially a native German speaker would gravitate more
> > towards Bezirksschornsteinfegermeister than "district chimney sweep
> > master". ;)

lol.


Post a reply to this message

From: clipka
Subject: Re: Illegal escape sequence in string?
Date: 4 Dec 2017 10:10:28
Message: <5a256564$1@news.povray.org>
Am 04.12.2017 um 09:28 schrieb Kenneth:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
>> use forward slashes for filenames.
>>
>> png "C:/Users/Sven Littkowski/Downloads/Images/POV-Ray Textures/SL - Cloud
>> Cities - Habitat - Heightfield.png" // the string is in one line
>>
> 
> But it's interesing that Windows itself uses back slashes for file locations.

Actually, Windows itself is fine with both forward and back slashes.

(There are a few minor issues with certain command shell (cmd.exe)
commands, but IIRC most of those go away if the file name is placed in
quotes.)


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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