POV-Ray : Newsgroups : povray.binaries.images : Sky simulation : Re: Sky simulation: what is wrong with this particular code? Server Time
30 Jul 2024 10:25:47 EDT (-0400)
  Re: Sky simulation: what is wrong with this particular code?  
From: scott
Date: 8 Jul 2013 03:54:52
Message: <51da704c$1@news.povray.org>
> Your code develop as:
> #declare X = 10;
> #local X = X - 1;
> In this contex, #local and #declare are synonims.
>
> So, yes, it works as expected.
>
> There is a difference when #local is used in an include file. In an
> include, any #local variables only exist within the include.

It is in an include, sorry in the above example the macro is in another 
file. Try this (two files):

// file1.inc
#macro A(B)
#local B = 5;
#end

// file2.pov
#include "file1.inc"
#declare X = 10;
A(X)
#warning concat("X = ",str(X,0,0))

X comes out as 5, but I would have expected 10.


Post a reply to this message

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