POV-Ray : Newsgroups : povray.general : #switch #case in function? : Re: #switch #case in function? Server Time
18 Jul 2024 06:45:06 EDT (-0400)
  Re: #switch #case in function?  
From: Cousin Ricky
Date: 16 Jun 2024 19:46:45
Message: <666f7965@news.povray.org>
On 2024-06-16 06:13 (-4), Ilya Razmanov wrote:
> Yet another stupid question from me: can I use "case" operator withing
> function? I can't figure it out.

Well... technically it is possible use #switch #case in a function
definition, but it will be evaluated only at parse time, freezing the
function definition at whatever the parse state was at that point.  This
is not generally useful.

So, do as Bill and Jr say: use select().  (I had to find this out the
hard way.)

Post a reply to this message

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