|
![](/i/fill.gif) |
I tried using the strcmp command but get an error now. I have tried it via
two methods.
First including the comparison in one line like so:
#if (strcmp(substr(MyStr,1,1),"1")=0)
#declare TL = -0.6;
#declare TR = -0.4;
#end;
And then by breaking up the commands to separate lines like so:
#declare SmallStr = substr(MyStr,1,1)
#declare ZeroFound = strcmp(SmallStr,"0");
#if (ZeroFound=0)
#declare TL = -0.6;
#declare TR = -0.4;
#end;
In each case Povray informs me that there is no matching } in text.
This code is within a text declaration.
I don't see what is suddenly causing the new error.
"Patrick Dugan" <pat### [at] usnetcomcorp com> wrote in message
news:3af94c4c$1@news.povray.org...
> I am trying to determine what the front of a string is and depending on
what
> that substring is declare certan values.
>
> I am using the following code:
>
> #if (substr(MyStr,1,1)="0")
> #declare TL = -0.6;
> #declare TR = -0.4;
> #end;
>
> Povray gives me an error on the #if line of:
>
> numeric expression expected but substr found instead.
>
> Is there anyway to get an #if statement to examine a substr for a value?
If
> not how do you get around this?
>
>
>
>
Post a reply to this message
|
![](/i/fill.gif) |