|
![](/i/fill.gif) |
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote in message
news:4aeea8ac$1@news.povray.org...
> This is a bit similar to SharkD's question above, but I wonder if it is
> possible.
>
> What I want to do is the following:
>
> #local PoserName = "Beggar_";
> #include concat(PoserName, "POV_geom.inc")
> #local ObjName = object {PoserName}
>
> The first two line of code work correctly, but the third one generates a
> parse error of course, as a string identifier instead of an object is
> found. How can I make this work?
>
> --
> All the best,
>
> Thomas
>
I assume that an object called 'Beggar_' is declared within the include
file?
If so you could use the Parse_String(String) macro. This macro takes a
string, writes it to a file, and then includes that file, effectively
evaluating the string, so:
#include "strings.inc"
Parse_String(concat("object {",PoserName,"}"))
should do it. Warning. I didn't test this for syntax errors.
Regards,
Chris B.
Post a reply to this message
|
![](/i/fill.gif) |