POV-Ray : Newsgroups : povray.general : #ifdef using a string expression? : Re: #ifdef using a string expression? Server Time
23 Mar 2023 23:38:06 EDT (-0400)
  Re: #ifdef using a string expression?  
From: jr
Date: 14 Mar 2023 09:25:00
Message: <web.6410757998df09c94301edef6cde94f1@news.povray.org>
hi,

Alain Martel <kua### [at] videotronca> wrote:

> > I was playing around with #ifdef recently; just experimenting.
> >
> > I put a nonsense string expression into it-- not actually defined anywhere-- to
> > see what would happen:
> >
> > #ifdef("htenneK")
> > ...
> As I see it, #ifdef() test the existence of an entity.
> With the quotes, the string DO exist, IS defined, even if it only exist
> locally. So, the test returns true.
> Without the quotes, it test if the variable exist, and, if it wasn't
> #declare beforehand, will return false.
>
> So, I think that it behave as it should.

agree, ref: <https://wiki.povray.org/content/Reference:Strings#String_Literals>


regards, jr.


Post a reply to this message

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