POV-Ray : Newsgroups : povray.newusers : if inside a macro syntax (if...else) : if inside a macro syntax (if...else) Server Time
30 Jul 2024 00:21:37 EDT (-0400)
  if inside a macro syntax (if...else)  
From: Rafal 'Raf256' Maj
Date: 29 Dec 2004 23:51:16
Message: <Xns95CF3BB3DD30Araf256com@203.29.75.35>
Hi,
syntax like

#local size = big ? 100 : 50;

(from C "operator?" ) isnt working, and writting it normaly as:

#if (big) #local size=100; #else #local size=50; #end

is quite long (I like to keep my syntax short). So I wanted to write a tiny 
IfElse function, like:

#macro IfElse(A,B,C) #if (A) 55 #else 30 #end #end

#local DD = IfElse(variant_Wide, 50, 100);

but it gaves a pares error.

I replaced it with good sytnax:
  #macro IfElse(A,B,C) select(A-1,C,B,C) #end
that do work, but just for curiosity, how to make previous syntax work 
also?

-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

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