|
![](/i/fill.gif) |
Jaime Vives Piqueres wrote:
> Well, thanks to a recent question by Thomas about Parse_String(), if
> you absolutely need to include code on a macro, there is a workaround
> using that function from strings.inc:
>
> Write the include file like this:
>
> #write(filehandle, "\"#declare CFS[",str(Count,0,0),"] = <", vstr(3,
> CFS[Count], ", ", -1,-1),">;\",\n")
>
> Then, instead using #include "data.inc", use a call to this macro:
>
> #macro ParseInclude(IncludeFile)
> #fopen filehandle IncludeFile read
> #while (defined(filehandle))
> #read (filehandle,IncludeLine)
> #debug IncludeLine
> #debug "\n"
> Parse_String(IncludeLine)
> #end
> #fclose filehandle
> #end
>
> like this:
>
> ParseInclude("data.inc")
>
>
> Hope this helps...
>
> --
> jaime
It's an interesting technique to say the least, and I must say that it works
all be it slow (I did implement it in this little animation). But the whole
point is that an #include should work inside a #macro.
The simplest workaround for me would be to put the #include in the main body
of the scene. I've done it and it works fine.
So it's not like "It doesn't work" but more like "It doesn't work the way it
should"
--
Ger
Post a reply to this message
|
![](/i/fill.gif) |