Suspected Template Double Include Bug

Posts   
 
    
jshallard
User
Posts: 62
Joined: 23-Mar-2005
# Posted on: 08-Jun-2005 12:27:45   

I have just started to use a "Custom_EntityInitializationTemplate" as per documentation to insert initialisation code into the BaseEntity classes.

The provided entityBase.template file contains the include "Custom_EntityInitializationTemplate" twice - once in the "InitClassEmpty" method, and once in the "InitClassFetch" method, like so:

 <# Custom_EntityInitializationTemplate #>

However, when generated, the include only seems to have worked for the first instance - in the "InitClassEmpty" method, and is ommited in second instance, in the "InitClassFetch" method.

However, if the first instance of the include is removed and the project re-generated, the include will work in the "InitClassFetch" method as this is now the first instance.

I am guessing that I am either missing something very simple, or this is a bug in the include engine when the same template is included more than once.

Any help appreciated.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 09-Jun-2005 11:15:55   

It's a bug in the parser. Well, ... more of an unforeseen side aspect. It processes include templates recursively, to process included templates in included templates. It keeps track of a list of seen included templateid's. So the second time a template is included, it simply skips it.

Of course not very clever, as it also could store the processed template while processing it and later on when it's included again simply re-use the processed text. I'll fix that.

(edit) Fixed in next build. Also for .lpt templates.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 10-Jun-2005 17:35:51   

Fix is now available (task performers)

Frans Bouma | Lead developer LLBLGen Pro