POV-Ray : Newsgroups : povray.general : #declare and semicolons Server Time
18 Nov 2024 07:19:03 EST (-0500)
  #declare and semicolons (Message 1 to 5 of 5)  
From: Andrew Coppin
Subject: #declare and semicolons
Date: 21 Sep 2002 15:16:06
Message: <3d8cc576@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have a question... Suppose I want to write a macro like

#macro Stuff(X, Y)
  X+Y
#end

Now, that's fine if I do

sphere {<7, 2, -6>, Stuff(11, 4)}

but if I try

#declare Banana = Stuff(6, 14);

I get a "no semicolon" error message. Is this a bug? Is there a way
round it? (Obviously the same thing occurs with vectors and colours.)

Thanks!
Andrew.

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPYzFb7EpzUF0Y1JeEQKDuQCfVpXjKT/mSxqDqCItTm9N6d/jh/UAoIfq
hYYce7NzlLoVFqjwEeSxiVq6
=arJn
-----END PGP SIGNATURE-----


Post a reply to this message

From: Slime
Subject: Re: #declare and semicolons
Date: 21 Sep 2002 15:47:39
Message: <3d8cccdb$1@news.povray.org>
Are you sure your macro doesn't look something like

#macro Stuff(a)
#if (a>1) 0
#else 1
#end
#end

'Cause if it does, changing it to

#macro Stuff(a)
#if (a>1) #local toreturn = 0
#else #local toreturn = 1
#end
(toreturn)
#end

will remove the problem.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Warp
Subject: Re: #declare and semicolons
Date: 21 Sep 2002 20:25:59
Message: <3d8d0e16@news.povray.org>
Andrew Coppin <orp### [at] btinternetcom> wrote:
> #declare Banana = Stuff(6, 14);

> I get a "no semicolon" error message.

  I don't. Which version of POV-Ray are you using?

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Andrew Coppin
Subject: Re: #declare and semicolons
Date: 22 Sep 2002 06:44:18
Message: <3d8d9f02@news.povray.org>
Amazingly enough, that does fix the problem! I don't know why the first way
doesn't work and the second one does, but hey, I'm happy now. Thanx!

"Slime" <slm### [at] slimelandcom> wrote in message
news:3d8cccdb$1@news.povray.org...
> Are you sure your macro doesn't look something like
>
> #macro Stuff(a)
> #if (a>1) 0
> #else 1
> #end
> #end
>
> 'Cause if it does, changing it to
>
> #macro Stuff(a)
> #if (a>1) #local toreturn = 0
> #else #local toreturn = 1
> #end
> (toreturn)
> #end
>
> will remove the problem.
>
>  - Slime
> [ http://www.slimeland.com/ ]
>
>


Post a reply to this message

From: Andrew Coppin
Subject: Re: #declare and semicolons
Date: 22 Sep 2002 06:44:19
Message: <3d8d9f03@news.povray.org>
I fluffed up. See my reply to Slime's message. [Sorry]

"Warp" <war### [at] tagpovrayorg> wrote in message
news:3d8d0e16@news.povray.org...
> Andrew Coppin <orp### [at] btinternetcom> wrote:
> > #declare Banana = Stuff(6, 14);
>
> > I get a "no semicolon" error message.
>
>   I don't. Which version of POV-Ray are you using?


Post a reply to this message

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