POV-Ray : Newsgroups : povray.general : #declare blah =3D -1; // bug avoidance (avoids "incomplete function or s= Server Time
28 Nov 2024 22:36:42 EST (-0500)
  #declare blah =3D -1; // bug avoidance (avoids "incomplete function or s= (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: Charles C
Subject: #declare blah =3D -1; // bug avoidance (avoids "incomplete function or s=
Date: 5 Aug 2006 16:20:01
Message: <web.44d4fc8241d0ca913869c6770@news.povray.org>
I've got a project I'm working on which uses a lot of splines.   I'm passing
splines to macros in some cases, and in other cases passing a counter
variable to a macro which in turn deals with splines.   Every once in a
while for either of these two situations I get the message "Parse Error:
Identifier expected, incomplete function call or spline call found
instead."   Well, so far the offending lines have looked good to me and in
fact do work:   Somehow I figured out that if I add a line a few lines up
like -

#declare blah = 1; // bug avoidance

- then it'll parse just fine.  I.e. the offending lines do their job.  This
"bug avoidance" line can be inside the same macro as the offending line, or
outside - it doesn't seem to matter.  If I see the problem again I'll often
just scroll up to where I most likely already have #declare blah = 1; and
change it to #declare blah = -1; or comment it out again, or add another
similar line.  It IS repeatable as long as the code doesn't change.

Longer #while loops containing likely offenders do seem to increase the
chances of getting the error.  The problem also compounds itself when there
are two separate macro calls next to each other which both have a tendancy
to "offend."   The "bug avoidance" line which fixes one macro call might
break the one next to it.  It looks like the trick here is to put a
bug-avoidance line in between the macro calls.

Anyway, I know this is all a bad way to deal with it; I want to know the
real cause.  I've found some macro calls which I had mistakenly left a
comma after the last parameter, but this hasn't been the case for the
problematic ones. However, I wouldn't be surprised if it were something
like this which Pov-Ray tolerates ....sometimes.


Does this sound familiar to anybody or should I start trying to create a
reasonably sized example?

Thanks for any tips.

Charles


Post a reply to this message

From: Charles C
Subject: Re: #declare blah =3D3D -1; // bug avoidance (avoids "incomplete functio=
Date: 5 Aug 2006 16:25:00
Message: <web.44d4fe4ede9730293869c6770@news.povray.org>
BTW, I meant to mention that I'm running POV 3.6 on WinXP.  Also I don't
remember typing "3D" in the the subject line to this thread.
Charles


Post a reply to this message

From: Tim Nikias
Subject: Re: #declare blah =3D3D -1; // bug avoidance (avoids "incomplete functio=
Date: 5 Aug 2006 20:29:43
Message: <44d537f7@news.povray.org>
Charles C wrote:
> BTW, I meant to mention that I'm running POV 3.6 on WinXP.  Also I don't
> remember typing "3D" in the the subject line to this thread.
> Charles

I guess it's related to the already known macro-bug: if you return 
results via the parameters, every now and then the parameter will be 
returned unchanged.

So, if your macro works like this:
#macro DoSomething(Variable)
   #declare Variable=Variable+1;
#end

#declare Value=2;
DoSomething(Value)
#debug concat(str(Value,1,0),"\n")

It will probably debug "3", but if you place it in a loop, every now and 
then a "2" will pop up. That bug, too, is heavily dependant on the scene 
and the error pops up differently on different PCs. It's known and 
should be fixed in 3.7 though.

You might want to try and check which macro this bug pops up in, maybe 
you can find the actual problem and a work-around.

Regards,
Tim

-- 
aka "Tim Nikias"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Norbert Melzer
Subject: Re: #declare blah = -1; // bug avoidance (avoids "incomplete function
Date: 5 Aug 2006 22:00:51
Message: <m81dmn9ri00d$.dlg@news.nobbz.de>
Am Sat,  5 Aug 2006 16:23:42 EDT schrieb Charles C:

> BTW, I meant to mention that I'm running POV 3.6 on WinXP.  Also I don't
> remember typing "3D" in the the subject line to this thread.

=3D is a replace for the equal (=) in a charset encoding called "quoted
printable" but this one is not declared in the Headers of your post, so
other readers can't recode it to the =-sign

So check the options of your UA.
Hmmm... Okay, I see you are reading and posting via Webinterface, so
there is a bug in the Interface...

Bye
Norbert


Post a reply to this message

From: Tom York
Subject: Re: #declare blah =3D -1; // bug avoidance (avoids "incomplete function
Date: 6 Aug 2006 11:25:01
Message: <web.44d609649da7a9017d55e4a40@news.povray.org>
The macro parameter bug has been fixed in MegaPov 1.2.1, if you're willing
to use an unofficial version.

Tom


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: #declare blah =3D -1; // bug avoidance (avoids "incomplete function
Date: 6 Aug 2006 11:45:38
Message: <44d60ea2$1@news.povray.org>
Tom York wrote:
> The macro parameter bug has been fixed in MegaPov 1.2.1, if you're willing
> to use an unofficial version.

Of course, it is also fixed in 3.7 betas.

	Thorsten


Post a reply to this message

From: Tom York
Subject: Re: #declare blah =3D3D -1; // bug avoidance (avoids "incomplete functio=
Date: 6 Aug 2006 17:25:00
Message: <web.44d65dad4562f33e7d55e4a40@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> Tom York wrote:
> > The macro parameter bug has been fixed in MegaPov 1.2.1, if you're willing
> > to use an unofficial version.
>
> Of course, it is also fixed in 3.7 betas.
>
>  Thorsten

Yes. I didn't mention the beta for obvious reasons.

Tom


Post a reply to this message

From: Tim Attwood
Subject: Re: #declare blah
Date: 7 Aug 2006 00:26:49
Message: <44d6c109$1@news.povray.org>
> I guess it's related to the already known macro-bug: if you return results 
> via the parameters, every now and then the parameter will be returned 
> unchanged.
>
> So, if your macro works like this:
> #macro DoSomething(Variable)
>   #declare Variable=Variable+1;
> #end

A good workaround is just to pass values by substitution instead...
#macro DoSomething(Variable)
   #declare result = Variable+1;
   (result)
#end

Then call the macro from a declare.
#declare Variable = DoSomething(Variable);


Post a reply to this message

From: Warp
Subject: Re: #declare blah =3D3D -1; // bug avoidance (avoids "incomplete functio=
Date: 7 Aug 2006 07:39:15
Message: <44d72663@news.povray.org>
Tom York <alp### [at] zubenelgenubi34spcom> wrote:
> Yes. I didn't mention the beta for obvious reasons.

  What reasons are those?

-- 
                                                          - Warp


Post a reply to this message

From: Tom York
Subject: Re: #declare blah =3D3D3D -1; // bug avoidance (avoids "incomplete funct=
Date: 7 Aug 2006 13:15:00
Message: <web.44d775086460b9637d55e4a40@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Tom York <alp### [at] zubenelgenubi34spcom> wrote:
> > Yes. I didn't mention the beta for obvious reasons.
>
>   What reasons are those?
>
> --
>                                                           - Warp

Because it's a beta, not a finished release? I'm under the strong impression
that the only reason for using the beta currently is to test it. Hence the
expiry, the warnings in the beta announcements about missing/possibly
missing features, and so on.

Tom


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

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