POV-Ray : Newsgroups : povray.beta-test : [doc] concat with one parameter : Re: [doc] concat with one parameter Server Time
29 Jul 2024 10:27:07 EDT (-0400)
  Re: [doc] concat with one parameter  
From: Christopher James Huff
Date: 21 May 2002 11:51:57
Message: <pan.2002.05.21.10.54.53.841372.2143@mac.com>
On Tue, 21 May 2002 11:13:40 -0500, Felix Wiemann wrote:

> Warp wrote:
>>   I don't understand why you can't give the value directly.
> 
> If the string is modified inside the macro but the original string is
> needed after execution, it's necessary to use concat. For example:

In that case, either the macro is written wrong or you are using it
wrong. The concat() function is for concatenating strings, not making
temporary copies. I don't see any reason to document that use, it is
basically a hack and should be discouraged because it leads to code that
appears to do something other than what it really does.

If you don't want to declare a temporary variable, a macro is a better
solution than misusing the concat() function. Something like:

#macro clonestring(String)
    #local tmpString = String
    tmpString
#end


-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: <chr### [at] tagpovrayorg>
WWW: http://homepage.mac.com/chrishuff/


Post a reply to this message

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