|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
POV 3.5 b 9.icl on PII 233 128 MB with NT 4 Sp 6
POV 3.5 b 9.icl on PII 233 128 MB with Win 95 OSR2
below script causes parsing error
"Expected 'object or directive', ; found instead"
#macro Test1() 1 #end
#macro Test2() #if(yes) 2 #end #end
#local F=Test1() // works
#local F=Test1(); // works
#local F=Test2() // works
#local F=Test2(); // not
Any confirmation ?
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Skiba <abx### [at] babilonorg> wrote:
> below script causes parsing error
> "Expected 'object or directive', ; found instead"
>
> #macro Test1() 1 #end
> #macro Test2() #if(yes) 2 #end #end
>
> #local F=Test1() // works
> #local F=Test1(); // works
> #local F=Test2() // works
> #local F=Test2(); // not
>
> Any confirmation ?
Semicolons are listed as required after every #local, #declare and #version
with a float, vector or color value. If you don't include the required
semicolon the problem is in your scene and the parser reports it as soon as
it is possible to report this.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Mon, 07 Jan 2002 13:18:44 +0100, "Thorsten Froehlich" <tho### [at] trfde>
wrote:
> Semicolons are listed as required after every #local, #declare and #version
> with a float, vector or color value. If you don't include the required
> semicolon the problem is in your scene and the parser reports it as soon as
> it is possible to report this.
I think you misunderstand my report so I post shorter example:
#macro Test2() #if(yes) 2 #end #end
#local F=Test2();
note: there is semicolon but parser expects object or directive
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Skiba <abx### [at] babilonorg> wrote:
> I think you misunderstand my report so I post shorter example:
>
> #macro Test2() #if(yes) 2 #end #end
> #local F=Test2();
>
> note: there is semicolon but parser expects object or directive
Indeed, I agree that this should work.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
: #macro Test2() #if(yes) 2 #end #end
: #local F=Test2();
Isn't the "right way" of returning values from a macro something like:
#macro Test2() #if(yes) #local res=2; #end res #end
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <3c39a9ef@news.povray.org> , Warp <war### [at] tagpovrayorg> wrote:
> Isn't the "right way" of returning values from a macro something like:
>
> #macro Test2() #if(yes) #local res=2; #end res #end
Hmm, what do the docs say about this? Maybe it should be made clear that
only data appearing in the macro block itself is considered a return
value...
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Mon, 07 Jan 2002 16:46:55 +0100, "Thorsten Froehlich" <tho### [at] trfde>
wrote:
> Hmm, what do the docs say about this? Maybe it should be made clear that
> only data appearing in the macro block itself is considered a return
> value...
6.2.8.3
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thorsten Froehlich wrote:
>
> ABX
> Skiba <abx### [at] babilonorg> wrote:
>
> > I think you misunderstand my report so I post shorter example:
> >
> > #macro Test2() #if(yes) 2 #end #end
> > #local F=Test2();
> >
> > note: there is semicolon but parser expects object or directive
>
> Indeed, I agree that this should work.
The problem appears under 3.1g as well, with the same fix as is
given elsewhere in this thread.
--
ICQ: 46085459
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Thorsten Froehlich" wrote:
> Hmm, what do the docs say about this? Maybe it should
> be made clear that only data appearing in the macro
> block itself is considered a return value...
It doesn't have anything to do with macros at all, as this also generates an
error:
#declare C = #if(1) 1 #else 2 #end ;
Rune
--
3D images and anims, include files, tutorials and more:
Rune's World: http://rsj.mobilixnet.dk (updated Jan 2)
POV-Ray Users: http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <3c39f966@news.povray.org>,
"Rune" <run### [at] mobilixnetdk> wrote:
> It doesn't have anything to do with macros at all, as this also generates an
> error:
>
> #declare C = #if(1) 1 #else 2 #end ;
If you wrap the conditional in parentheses, it will work fine:
#declare C = (#if(1) 1 #else 2 #end);
#macro Test2() (#if(yes) 2 #end) #end
#local F = Test2();
--
--
Christopher James Huff <chr### [at] maccom>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |