|
![](/i/fill.gif) |
In article <407004ff@news.povray.org>,
Andrew C on Mozilla <voi### [at] dev null> wrote:
> I was then shocked to find that
> #if (Flag = "Z")
> gives me an error... it was later pointed out that
> #if (asc(Flag) = asc("Z"))
> works just fine. Weird... Anyway, I went this way because "nCV" is more
> instantly understandable than 0x03. ;-) Just a thought...
The equality operator expects numeric values, which strings aren't. Not
so weird, though scripting languages usually have better built-in
support for strings, POV Script isn't intended to do much string
processing. Anyway, that's an odd way of comparing strings, and only
works for single characters. This is the usual method:
#if(strcmp(Flag, "Z") = 0)
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tag povray org>
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |