Magnatune: We
Are Not Evil
  POV-Ray : Newsgroups : povray.newusers : Problem with #switch : Re: Problem with #switch Server Time: 6 Jul 2008 09:41:04 GMT
  Re: Problem with #switch  
From: Chris B
Date: 12 Feb 2008 08:28:46
"Archpawn" <nomail@nomail> wrote in message 
news:web.47b0ded4bd25e05c9c37dbc40@news.povray.org...
> When I try to compile the following code, it says there should be a ) 
> after X+1.
> Am I doing this right? It's supposed to return X+1 if Dir = 0 or 1, X if 
> it's 2
> or 5, and X-1 if it's 3 or 4.
> #macro NextX(X,Dir)
>   #switch(Dir)
>      #case(0)
>      #case(1)
>         X+1
>      #break
> ... snip ...

I cut and pasted your macro into a new empty file and added the one line
#debug concat("AAAAA: ",str(NextX(1,0),3,0),"\n")

I ran it with a couple of different parameters and it worked as expected 
(Black image, but a number returned to the message stream).

Are you sure you don't have an error in the main body of your code?
If you've got an open bracket out of place before any of the macro 
invocations, then that would explain the message.

Regards,
Chris B.


Post a reply to this message

Copyright 1991-2004 POV-Team™