POV-Ray : Newsgroups : povray.general : How to use #ifdef? Server Time
28 Mar 2024 11:43:43 EDT (-0400)
  How to use #ifdef? (Message 1 to 4 of 4)  
From: Kima
Subject: How to use #ifdef?
Date: 12 Jun 2020 14:25:01
Message: <web.5ee3c827d247f9afecc0fada0@news.povray.org>
I have trouble to use #ifdef and #ifndef for multiple conditions. Can you
provide the correct syntax for the following cases:

1. #ifdef(a1) ...
   #else #ifdef(a2) ....
   #else ...

2. #ifdef(a1) & (a1=1) ...

3. #ifdef(a1) & #ifdef(a2) ...


Post a reply to this message

From: jr
Subject: Re: How to use #ifdef?
Date: 12 Jun 2020 14:45:00
Message: <web.5ee3cc0d353de50c4d00143e0@news.povray.org>
hi,

"Kima" <nomail@nomail> wrote:
> I have trouble to use #ifdef and #ifndef for multiple conditions. Can you
> provide the correct syntax for the following cases:
>
> 1. #ifdef(a1) ...
>    #else #ifdef(a2) ....
>    #else ...
>
> 2. #ifdef(a1) & (a1=1) ...
>
> 3. #ifdef(a1) & #ifdef(a2) ...

1. #if (defined(a1))
   #elseif (defined(a2))
   #else
   #end

2. #if (a1 & 1 = a1)

3. #if (a1 & a2)


regards, jr.


Post a reply to this message

From: jr
Subject: Re: How to use #ifdef?
Date: 12 Jun 2020 14:50:01
Message: <web.5ee3ce2b353de50c4d00143e0@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "Kima" <nomail@nomail> wrote:
> > I have trouble to use #ifdef and #ifndef for multiple conditions. Can you
> > provide the correct syntax for the following cases:
> >
> > 1. #ifdef(a1) ...
> >    #else #ifdef(a2) ....
> >    #else ...
> >
> > 2. #ifdef(a1) & (a1=1) ...
> >
> > 3. #ifdef(a1) & #ifdef(a2) ...
>
> 1. #if (defined(a1))
>    #elseif (defined(a2))
>    #else
>    #end
>
> 2. #if (a1 & 1 = a1)
>
> 3. #if (a1 & a2)

oh sh*t.  :-(  sorry.

2.  #if (defined(a1) & 1 = a1)
3.  #if (defined(a1) & defined(a2))



regards, jr.


Post a reply to this message

From: Kima
Subject: Re: How to use #ifdef?
Date: 12 Jun 2020 15:00:00
Message: <web.5ee3d08d353de50cecc0fada0@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> "jr" <cre### [at] gmailcom> wrote:
> > hi,
> >
> > "Kima" <nomail@nomail> wrote:
> > > I have trouble to use #ifdef and #ifndef for multiple conditions. Can you
> > > provide the correct syntax for the following cases:
> > >
> > > 1. #ifdef(a1) ...
> > >    #else #ifdef(a2) ....
> > >    #else ...
> > >
> > > 2. #ifdef(a1) & (a1=1) ...
> > >
> > > 3. #ifdef(a1) & #ifdef(a2) ...
> >
> > 1. #if (defined(a1))
> >    #elseif (defined(a2))
> >    #else
> >    #end
> >
> > 2. #if (a1 & 1 = a1)
> >
> > 3. #if (a1 & a2)
>
> oh sh*t.  :-(  sorry.
>
> 2.  #if (defined(a1) & 1 = a1)
> 3.  #if (defined(a1) & defined(a2))
>
>
>
> regards, jr.

Wonderful! I dug all the documentation to find "defined" operator. Silly of me!


Post a reply to this message

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