|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hello
I just discovered something, which Looks to me like a bug: When I try to use
#while in a macro, I get an error-message:
Parse Error: No matching } in 'object', object found instead
I append the code which triggers the error:
//---------------------------------------------------------------------
#declare myBox = box {<0,0,0> <1,1,1> texture{pigment{color <1,1,1>}}}
#macro myMacro (myStart, myEnd, myBox)
#local myVar = myStart;
#while (myVar <10)
object {myBox translate <myVar,0,0>} //Here occurs the error
#local myVar = myVar + 2;
#end
#end
object { myMacro (0, 20, myBox)}
//---------------------------------------------------------------------
Maybe there's a solution from someone...
Greetings
Juerg
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"ruti" <jru### [at] ruti-agch> wrote:
> Hello
> I just discovered something, which Looks to me like a bug: When I try to use
> #while in a macro, I get an error-message:
>
> Parse Error: No matching } in 'object', object found instead
>
> I append the code which triggers the error:
>
>
> //---------------------------------------------------------------------
> #declare myBox = box {<0,0,0> <1,1,1> texture{pigment{color <1,1,1>}}}
>
> #macro myMacro (myStart, myEnd, myBox)
> #local myVar = myStart;
>
> #while (myVar <10)
> object {myBox translate <myVar,0,0>} //Here occurs the error
> #local myVar = myVar + 2;
> #end
> #end
>
> object { myMacro (0, 20, myBox)}
> //---------------------------------------------------------------------
>
Using Windows 8 and POVRAY-Version 3.7 (64)
> Maybe there's a solution from someone...
>
> Greetings
> Juerg
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Le 16/01/2016 14:32, ruti a écrit :
> #end
>
> object { myMacro (0, 20, myBox)}
expanding by hand :
object { object { myBox ...
invalid construction.
Drop the 'object {' in front of myMacro and you will be fine.
Or replace it with an union.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iJwEAQEIAAYFAlaaSh4ACgkQhKAm8mTpkW3KcAQAsqbwOZRsRHytJujgviwh8XRa
s/jShkZx4keLrrsdDc6C0Um+nYaJGP927xsqtj4IiaHwZN2XqZo4xwT7DkIJ8WHy
eDXuahBnWFaMHRPGrGVY857RfjuS4AHiedMH7qBn/4LkMl41cbOWbsipGizKzeVd
3F/3VKSxmBI3Sjhinjw=
=mrgJ
-----END PGP SIGNATURE-----
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 16.01.2016 um 14:48 schrieb Le_Forgeron:
> Le 16/01/2016 14:32, ruti a écrit :
>> #end
>
>> object { myMacro (0, 20, myBox)}
>
> expanding by hand :
>
> object { object { myBox ...
>
>
> invalid construction.
No, that should be perfectly fine.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 16.01.2016 um 14:32 schrieb ruti:
> I just discovered something, which Looks to me like a bug: When I try to use
> #while in a macro, I get an error-message:
Ho-hum! Let's not be hasty. What happened to the good old-fashioned "am
I doing something wrong myself?" phase of troubleshooting? Gone out of
style?
> Parse Error: No matching } in 'object', object found instead
No surprise there, because this code...
> #macro myMacro (myStart, myEnd, myBox)
> #local myVar = myStart;
>
> #while (myVar <10)
> object {myBox translate <myVar,0,0>} //Here occurs the error
> #local myVar = myVar + 2;
> #end
> #end
>
> object { myMacro (0, 20, myBox)}
... essentially expands to:
object {
// your macro begins here
// a single iteration of your loop begins here
object { ... }
// a single iteration of your loop ends here
// a single iteration of your loop begins here
object { ... }
// a single iteration of your loop ends here
// a single iteration of your loop begins here
object { ... }
// a single iteration of your loop ends here
...
// your macro ends here
}
You can't bundle multiple objects in a single "object {...}" statement,
because... well, it's simply not what it is supposed to do. That would
be the "union" statement instead.
Either change the macro invocation to:
union { myMacro (0, 20, myBox)}
or change the macro to:
#macro myMacro (myStart, myEnd, myBox)
union {
#local myVar = myStart;
#while (myVar <10)
...
#end
}
#end
Not a bug. Case closed. If you have any more inquiries, please move on
to povray.general, povray.newusers or povray.advanced, depending on the
level of expertise you presume to have.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
clipka <ano### [at] anonymousorg> wrote:
> Am 16.01.2016 um 14:32 schrieb ruti:
>
> > I just discovered something, which Looks to me like a bug: When I try to use
> > #while in a macro, I get an error-message:
>
> Ho-hum! Let's not be hasty. What happened to the good old-fashioned "am
> I doing something wrong myself?" phase of troubleshooting? Gone out of
> style?
>
> > Parse Error: No matching } in 'object', object found instead
>
> No surprise there, because this code...
>
> > #macro myMacro (myStart, myEnd, myBox)
> > #local myVar = myStart;
> >
> > #while (myVar <10)
> > object {myBox translate <myVar,0,0>} //Here occurs the error
> > #local myVar = myVar + 2;
> > #end
> > #end
> >
> > object { myMacro (0, 20, myBox)}
>
> ... essentially expands to:
>
> object {
> // your macro begins here
> // a single iteration of your loop begins here
> object { ... }
> // a single iteration of your loop ends here
> // a single iteration of your loop begins here
> object { ... }
> // a single iteration of your loop ends here
> // a single iteration of your loop begins here
> object { ... }
> // a single iteration of your loop ends here
> ...
> // your macro ends here
> }
>
> You can't bundle multiple objects in a single "object {...}" statement,
> because... well, it's simply not what it is supposed to do. That would
> be the "union" statement instead.
>
> Either change the macro invocation to:
>
> union { myMacro (0, 20, myBox)}
>
> or change the macro to:
>
> #macro myMacro (myStart, myEnd, myBox)
> union {
> #local myVar = myStart;
>
> #while (myVar <10)
> ...
> #end
> }
> #end
>
>
> Not a bug. Case closed. If you have any more inquiries, please move on
> to povray.general, povray.newusers or povray.advanced, depending on the
> level of expertise you presume to have.
Sorry for that...
These two statements I tried and they work:
myMacro (0, 20, myBox)
union {myMacro (0,20,myBox)}
Thanks
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|