POV-Ray : Newsgroups : povray.general : #macro question : Re: #macro question Server Time
7 Aug 2024 09:26:19 EDT (-0400)
  Re: #macro question  
From: Warp
Date: 11 Oct 2001 05:39:42
Message: <3bc568dd@news.povray.org>
Mike Williams <mik### [at] nospamplease> wrote:
: Another way of thinking about what POV macros return would be to
: consider that Fred(1,3) doesn't return an array, it returns the *text*

  This is not the whole story. #local declarations are not seen outside the
macro, although the value of a locally declared identifier can be passed
outside the macro.
  This example shows how this #local behaviour is seen in practice:

#macro MyMacro()
  #local MyVar = 5;
#end

#declare MyVar = 2;
MyMacro()
#debug str(MyVar,0,0) // 'MyVar' is still 2 here!

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


Post a reply to this message

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