POV-Ray : Newsgroups : povray.general : #macros-- a simple question : Re: #macros-- a simple question Server Time
28 Apr 2024 20:16:48 EDT (-0400)
  Re: #macros-- a simple question  
From: Simon J  Cambridge
Date: 8 Jul 2017 17:25:00
Message: <web.59614d261c20efa621bb12460@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> This little problem makes me feel like I'm losing more brain cells than normal,
> as I get older. But I'll explain anyway...
>
> From my (faulty??) memory of POV-Ray v3.6xx days, I thought that a #macro could
> be written *anywhere* in a scene file, and called from anywhere. In other words,
> no need to write the two in a 'linear' way in the file-- #macro first, THEN the
> call. But I now see that in 3.7xx (3.7.1 beta 8), a #macro needs to be written
> 'higher up' in the file, before it's called later in the scene. (Doing the
> reverse doesn't work.) For some strange reason, this comes as a surprise to
> me(!)
>
> Did v3.6xx operate differently?
>
> *** By the way, the in-built documentation about macros says only this: "A macro
> must be declared before it is invoked."  Hmm. Depending on how I read that, it
> could mean the *obvious* fact that something-- anything-- needs to be created
> before it can be used. OR, it could mean that the #macro definition needs to be
> WRITTEN earlier in the scene file first, to be FOLLOWED by the invocation of it
> later (like any other linear-programming item.) The wording is a wee bit too
> simplistic and ambiguous.

I just tried this in 3.62 and it must be linear, macro first (higher up), then
its invocation, lower down.

As soon as I saw your question it made wonder...

Cheers,

Simon.


Post a reply to this message

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