POV-Ray : Newsgroups : povray.general : parsing problem in POVRay : Re: parsing problem in POVRay Server Time
4 Nov 2024 21:22:40 EST (-0500)
  Re: parsing problem in POVRay  
From: JC (Exether)
Date: 3 Sep 2003 02:13:24
Message: <3f558684@news.povray.org>
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

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