` Printed Icetips Article

Icetips Article



Templates: Example of making template embeds available in embeditor
1999-07-22 -- Richard Stollar
 
Newsgroups: TopSpeed.Topic.Templates

Editors note:  Please note that some lines may wrap in the template code.

I have actually had a number of people wanting the information to this
problem and had I thought that there would be people who really wanted to
know how to do this then I would have posted the solution right away.

Anyway, Here it is...

If like me when you created your template chain you used the CW template
chain as a base then all you need to do is add the following block of code


#! ------------------------------------------------------------------------------
#!
#! Main Source Code Generation Loop.
#!
#! -------------------------------------------------------------------------
-----
#!
#DECLARE (%GlobalRegenerate)                      #! Flag that controls
generation
#IF (%EditProcedure)                              #! Special case for
editing embedded source in context
  #CREATE(%EditFilename)
  #FIND(%ModuleProcedure,%EditProcedure)
  #FIX(%Procedure,%ModuleProcedure)           #! Fix current procedure
  #MESSAGE('Generating Module:    ' & %Module,1) #! Post generation message
  #MESSAGE('Generating Procedure: ' & %Procedure,2) #! Post generation
message
  #GENERATE(%Procedure)                       #! Generate procedure code
  #CLOSE
  #ABORT
#ENDIF
#IF (~%ConditionalGenerate OR %DictionaryChanged OR %RegistryChanged)
  ....

Hope that this makes sence to you all... You will find the code in CW.TPL
too.

Regards,

Richard Stollar.



Printed November 21, 2024, 7:07 am
This article has been viewed/printed 35202 times.
Google search has resulted in 14 hits on this article since January 25, 2004.