POV-Ray : Newsgroups : povray.beta-test : [DOC] 6.2.2 The #declare and #local directives Server Time
30 Jul 2024 12:32:24 EDT (-0400)
  [DOC] 6.2.2 The #declare and #local directives (Message 1 to 3 of 3)  
From: Mark Wagner
Subject: [DOC] 6.2.2 The #declare and #local directives
Date: 26 Oct 2001 23:30:59
Message: <3bda2a73@news.povray.org>
In section 6.2.2.1, it says:
"Declarations, like most language directives, can appear anywhere in the
file - even within other statements. "

However, there is an exception to this: you cannot put a declaration, or any
other language directive, in the middle of an array initialization.  For
example, the following is not allowed:

#declare SplineData = array[6]
{ <.6,1,-.1>,        <.54,1,-.6>,    <.5,.35,-.9>,  <.6,.35,-1.25>,
   <.6,.35,-1.65>, #declare a = 0.7;  <.3, a, -.73> }

Later in that section, it says:
"However if you attempt to re-declare an identifier as anything other than
its original type, it will generate a warning message."

This is no longer true.

In section 6.2.2.4, the line "See also "The #ifdef and #ifndef Directives""
is not a hyperlink.

--
Mark


Post a reply to this message

From: ingo
Subject: Re: [DOC] 6.2.2 The #declare and #local directives
Date: 27 Oct 2001 07:10:03
Message: <Xns914785F2524ACseed7@povray.org>
in news:3bda2a73@news.povray.org Mark Wagner wrote:

> In section 6.2.2.1, it says:
> "Declarations, like most language directives, can appear anywhere
> in the file - even within other statements. "
> 
> However, there is an exception to this: 

 If I understood ABX' posts, he also has problems with this line. A 
simple solution would be:

"Declarations, like most language directives, can appear almost 
anywhere in the file - even within other statements. "

 This is not a solution out of laziness, but I hasitate to include one 
or two examples of exceptions. If sombody can put together a list of 
*all* exceptions, or can come up with some general text that clearly 
defines in what sort of situations exceptions may happen, I'll include 
it.



other points will be fixed.


Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From:
Subject: Re: [DOC] 6.2.2 The #declare and #local directives
Date: 29 Oct 2001 03:13:16
Message: <hf3qtt86ain5t9psas6shqlfvtvhavesns@4ax.com>
On 27 Oct 2001 07:10:03 -0400, ingo <ing### [at] homenl> wrote:
> in news:3bda2a73@news.povray.org Mark Wagner wrote:
>
> > In section 6.2.2.1, it says:
> > "Declarations, like most language directives, can appear anywhere
> > in the file - even within other statements. "
> > 
> > However, there is an exception to this: 
>
>  If I understood ABX' posts, he also has problems with this line.

not only me :-)
http://news.povray.org/3BB82B3F.18814A7F@gmx.de

> A simple solution would be:
>
> "Declarations, like most language directives, can appear almost 
> anywhere in the file - even within other statements. "
>
> This is not a solution out of laziness, but I hasitate to include one 
> or two examples of exceptions. If sombody can put together a list of 
> *all* exceptions, or can come up with some general text that clearly 
> defines in what sort of situations exceptions may happen, I'll include 
> it.

without writing exceptions IMO this setence could be more accurate

ABX
--
#declare _=function(a,b,x){((a^2)+(b^2))^.5-x}#default {pigment{color rgb 1}}
union{plane{y,-3}plane{-x,-3}finish{reflection 1 ambient 0}}isosurface{ //ABX
function{_(x-2,y,1)|_((x+y)*.7,z,.1)|_((x+y+2)*.7,z,.1)|_(x/2+y*.8+1.5,z,.1)}
contained_by{box{<0,-3,-.1>,<3,0,.1>}}translate z*15finish{ambient 1}}//POV35


Post a reply to this message

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