POV-Ray : Newsgroups : povray.general : Request for enhancement : Re: Request for enhancement Server Time
8 Aug 2024 20:22:22 EDT (-0400)
  Re: Request for enhancement  
From: Chris Huff
Date: 4 Dec 2000 16:15:51
Message: <chrishuff-163A13.16163404122000@news.povray.org>
In article <3A2BA6E1.8E54FEF4@pacbell.net>, lin### [at] povrayorg 
wrote:

> Careful ! Everytime I think something is impossible to do with
> POV-Ray Mr. Colefax or Mr. Parker comes along and show just how
> possible it really is :)

Well, this *is* impossible without modifying the source, because there 
is no way to declare a #local variable for use in a macro calling a 
macro...

This macro:

#macro assignLocal(Var, Value) #local Var = Value; #end

will not do the job correctly, it will just define a variable that is 
local to the assignLocal macro.
Actually, #declare, as used in the original macro, *might* work, if 
there is a specific side-effect of the way POV handles modifying of 
parameters...if "#declare ParamName" doesn't do what "#declare VarName" 
does. I don't know if this side-effect exists, or even if it would be a 
bug or feature...something to try and see.

BTW, another problem with that assign() macro: it uses a semicolon, 
which will prevent you from using objects, textures, etc...you could 
remove that semicolon:
#macro assign(Var, Value) #declare Var = Value #end
but this will produce a warning whenever you use it with a vector, 
color, or float, which can slow parsing down and may not work at all in 
future versions(semicolons really should be used, or at least allowed, 
for all variable declarations!).

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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