|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | Why does following not parse in POV (3.1):
----------------------
#macro return1()
        #if (1=1)
         1
        #end    
#end
#declare one=return1()
#debug "done\n\n\n"
#if (return1()=1)
        #debug "done."
#end
----------------------
... gives " xxx.pov:3: error: ) expected but # found instead. "
I could not find anything in the docs saying that this is not possible. Is 
it working in 3.5beta?
- Micha
Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | On Wed, 26 Sep 2001 18:23:32 +0200, Micha Riser <mri### [at] gmx net>
wrote:
> Is it working in 3.5beta?
no
and I found shortest code for investigate bug
#if(#if(yes)yes#end)#end
I looks like bug with "if" inside "if"
I will report it to povray.beta-test but I'm sure THEY saw this
ABX Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | In article <4ev### [at] micha riser>, mri### [at] gmx  net says...
> #macro return1()
>         #if (1=1)
>          1
>         #end    
> #end
This is the problem I guess. It doesn't work this way, I don't know why, 
probably a bug.
Do it like this and it should work (at least in MP and 3.5):
#macro return1()
	#if(1=1)
		#local out=1;
	#else // just for the case 1 doesn't equal 1 *g*
		#local out=0; 
	#end
	out
#end
Lutz-Peter Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | Micha Riser <mri### [at] gmx net> wrote:
> Why does following not parse in POV (3.1):
[snip]
> ... gives " xxx.pov:3: error: ) expected but # found instead. "
>
> I could not find anything in the docs saying that this is not possible. Is
> it working in 3.5beta?
Try enclosing your calls to the macro in brackets, i.e:
#declare one=(return1());
#debug "done\n\n\n"
#if ((return1())=1)
        #debug "done."
#end
This should allow POV-Ray to correctly interpret the returned value, and
things should work as expected. Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | Chris Colefax wrote:
> 
> Try enclosing your calls to the macro in brackets, i.e:
> 
> #declare one=(return1());
> #debug "done\n\n\n"
> 
> #if ((return1())=1)
>         #debug "done."
> #end
> 
> This should allow POV-Ray to correctly interpret the returned value, and
> things should work as expected.
Thanks, this works! It is a bit nicer than the workaround with an extra 
variable.
- Micha
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  |