POV-Ray : Newsgroups : povray.general : Macro return value on failure : Re: Macro return value on failure Server Time
23 Apr 2024 15:32:39 EDT (-0400)
  Re: Macro return value on failure  
From: Mike Horvath
Date: 22 Jul 2018 00:04:36
Message: <5b540254$1@news.povray.org>
On 7/21/2018 10:45 PM, clipka wrote:
> You could return a 3D vector, using the 3rd dimension for a status value.
> 
> If you are using POV-Ray v3.8.0, you could also use:
> 
>      #macro Line_Intersection(...)
>          ...
>          #if (D != 0)
>              ...
>              #local Out_Value = <out_x,out_y>;
>              #local Out_Ok = true;
>          #else
>              #local Out_Value = <0,0>;
>              #local Out_Ok = false;
>          #end
>          (Out_Value, Out_Ok)
>      #end
>      ...
>      #declare (R, R_Ok) = Line_Intersection(...);
>      #if (R_ok)
>          ...
>      #else
>          ...
>      #end
> 
> 
> (As an unrelated side note, it is highly recommended to /not/ use
> all-lowercase variable names; such names might be used as new keywords
> in future versions without special notice.)
> 

Thanks!

Now I am afraid because I use lower case for variable names almost 
exclusively.

:(


Post a reply to this message

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