|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I think I found a potential bug that I couldn't find in the know bugs,
so I report here, I hope it's the right group. Here is the code :
#macro Return_Int (A)
#if (A>0)
A
#else
0
#end
#end
#local Var1=Return_Int (5);
You don't need any light or camera, POV-Ray complains that there should
be a ';' at line 3 after the returned 'A' which I wouldn't expect. When
I write :
#macro Return_Int (A)
#if (A>0)
A;
#else
0;
#end
#end
#local Var1=Return_Int (5)
It works, but I see that more like a workaround than a correct syntax.
I hope it helps improving our worshiped POV,
JC
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Wasn't it JC (Exether) who wrote:
>I think I found a potential bug that I couldn't find in the know bugs,
>so I report here, I hope it's the right group. Here is the code :
>
>#macro Return_Int (A)
> #if (A>0)
> A
> #else
> 0
> #end
>#end
>
>#local Var1=Return_Int (5);
The conventional way of writing this so that POV accepts it would be to
put it in brackets, like this:
#macro Return_Int (A)
#if (A>0)
A
#else
0
#end
#end
#local Var1=(Return_Int(5));
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"JC (Exether)" <no### [at] spamfr> wrote:
> #macro Return_Int (A)
> #if (A>0)
> A
> #else
> 0
> #end
> #end
This is a typical place for making a mistake in the SDL syntax (and
perhaps would reserve an entry in the povQ&T page).
The right way of doing this is:
#macro Return_Int (A)
#if (A>0)
#local retval = A;
#else
#local retval = 0;
#end
retval
#end
The reason for this is because how the parser works... But it's a bit
too complicated for me to explain this late at night. :)
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mike Williams <mik### [at] econymdemoncouk> wrote:
> The conventional way of writing this so that POV accepts it would be to
> put it in brackets, like this:
There's no need if you write the macro properly (as I explained in the
other post).
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Would you mind doing so someday in
the early morning? :-)
I'm just curious, that's all. Doing it like you
described for some time now, but never
got the technical answer why that is better...
Regards,
Tim
--
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
> "JC (Exether)" <no### [at] spamfr> wrote:
> > #macro Return_Int (A)
> > #if (A>0)
> > A
> > #else
> > 0
> > #end
> > #end
>
> This is a typical place for making a mistake in the SDL syntax (and
> perhaps would reserve an entry in the povQ&T page).
> The right way of doing this is:
>
> #macro Return_Int (A)
> #if (A>0)
> #local retval = A;
> #else
> #local retval = 0;
> #end
> retval
> #end
>
> The reason for this is because how the parser works... But it's a bit
> too complicated for me to explain this late at night. :)
>
> --
> #macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb
x]
> [1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
> -1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// -
Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
For beeing in computer programming I think I understand why the parser
works this way, thanks for giving me way to make it work fine, it is the
way every function returning value should be writen anyway, so that's
cool, POV-Ray is actually enforcing good practices. :-)
JC
Warp wrote:
> "JC (Exether)" <no### [at] spamfr> wrote:
>
>>#macro Return_Int (A)
>> #if (A>0)
>> A
>> #else
>> 0
>> #end
>>#end
>
>
> This is a typical place for making a mistake in the SDL syntax (and
> perhaps would reserve an entry in the povQ&T page).
> The right way of doing this is:
>
> #macro Return_Int (A)
> #if (A>0)
> #local retval = A;
> #else
> #local retval = 0;
> #end
> retval
> #end
>
> The reason for this is because how the parser works... But it's a bit
> too complicated for me to explain this late at night. :)
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|