|
![](/i/fill.gif) |
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:
#macro M(S)
#debug "\n" // linefeed
#debug S // "POV-Ray"
#debug "\n"
#declare S = substr(S, 5, 3) // S = "Ray"
#debug S // "Ray"
#debug "\n"
#end
#declare S = "POV-Ray"
M(concat(S))
#debug substr(S, 1, 3) // "POV" or "Ray"
The output is:
POV-Ray
Ray
POV
but if you change M(concat(S)) to M(S) the output is:
POV-Ray
Ray
Ray
--
Felix Wiemann
Post a reply to this message
|
![](/i/fill.gif) |