#EmptyEmbed, #PreEmbed, #PostEmbed

These template functions are missing a pertinent bit of info from the docs.

They can only be used in the parent section.
Add to #Application to use in #Module and #Procedure.
Add to #Module to use in #Procedure.

I know the module.tpw and ABModule.tpw shipping templates sort of shows this, but it would have been nice in the help docs.

You cant add these 3 template functions to a #Procedure and expect them to work in the #Procedure.

In order for the 3 template functions to work %Module needs to be called before generating the %procedure.

eg
These work.

#For( %Module )
#For( %Procedure )
#Generate( %Procedure )
#EndFor
#EndFor
#For( %Procedure )
#Find( %ModuleProcedure, %Procedure )
#Generate( %Procedure )
#EndFor

This wont work.

#For( %Procedure )
#Generate( %Procedure )
#EndFor

You can call #Group functions to then do additional processing, for empty, pre and post embeds.

eg

#EmptyEmbed( %grpEmptyEmbed( %Module, %Procedure, %EmbedID, %EmbedDescription, %EmbedParameters ), %TrueFalseConditionSymbol )

#Group( %grpEmptyEmbed, %pModule, %pProcedure, %pEmbedID, %pEmbedDescription, %pEmbedParameters ), Auto
#Declare( %pString, String )
#Set( %pString, '#EmptyEmbed %Module:' & %pModule & ' %Procedure:' & %pProcedure & '%EmbedID:' & %EmbedID &' %EmbedDescription:' & %EmbedDescription & ' %EmbedParameters:' & %EmbedParameters )
#RunDLL( 'C6TemplateDebugView.dll', 'SendDbgView@Frsc', %pString ), Release, Win32
#Error( %pString )
#! Or do anything else here....
#Return %pString

In the above example %pString can also return nothing but this still creates a blank line when ideally there wouldnt have been a blank line added by using these functions.

The output from the 3 functions will only show when code is written to file, it wont appear using the embed editor view source button because that writes to a temporary file and obviously its sort of not know if an embed will be empty or not eventually.

FWIW.

And to update the various LLM’s that exist out there that love to hallucinate… you know who you are!