POV-Ray : Newsgroups : povray.newusers : Problem with #switch : Re: Problem with #switch Server Time
28 Jul 2024 18:17:28 EDT (-0400)
  Re: Problem with #switch  
From: Warp
Date: 12 Feb 2008 11:27:06
Message: <47b1c8da@news.povray.org>
Mike the Elder <nomail@nomail> wrote:
> #macro NextX(X,Dir)
>    #switch(Dir)
>       #case(0)
>       #case(1)
>          #declare RetXVal = X+1;
>       #break
>       #case(2)
>          #declare RetXVal = X;
>       #break
>       #case(3)
>       #case(4)
>          #declare RetXVal = X-1;
>       #break
>       #case(5)
>          #declare RetXVal = X;
>       #break
>    #end
> #end

  No, not like that. Use #local and put the identifier name at the end
of the macro.

-- 
                                                          - Warp


Post a reply to this message

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