How to know the Family() of a Template

In #Template(name,description),Private,Family(sets) the sets are basically Clarion or ABC, or others, but there doesnt appear to be any symbol in which to extract this info.

I see in the shipping templates, some hidden prompts which had created %AppTemplateFamily where they are assigned either Clarion or ABC, but thats it, it appears to be a work around to the situation that there is no way of finding out the base template from a symbol, or am I wrong?


I should add, I can find out what the template set is from parsing various symbols like %Application, and %ActiveTemplate to see is there is an ABC or Clarion encapsulated in brackets/parenthesis, but I really wanted to find out what the base template or main template was from another template.

correct, there isn’t.

Detection of which chain (ABC or Clarion) is somewhat complicated by how far back you want to go. Over the years it’s gotton easier, but old code to support older clarion versions is still in play in some cases.

But assuming “something modern” (which I think includes C6), all the templates (ABC, Clarion, Ipserver) declare a variable in global scope , %AppTemplateFamily - see Abchain.Tpl for an example. Other templates can test for this (VarExists) and use it.

If you are generting new template chains I would strongly suggest following this pattern (of including an %AppTemplateFamily global prompt.)

1 Like

Looking at the data I can get out of the various symbols at different sections, ie #Application/#Program aka Global level, and #Module/#Procedure levels the VarExists(%symbol) and then parsing seems to be the only way.

I havent tried VarExists() with an %EmbedIdentifier yet, I’ll give that a go and see what happens, but what you have suggested is what I’m having to use for now.

For #AT symbols the command you use is EXISTS not VAREXISTS.

1 Like

I’m getting the error message
Error:#AT not valid in a #Group so I’m having to refactor the code back into one big section of template code.

Just found Registered() as in #If(Registered(‘TemplateName(Family)’) which according to the docs should also work for everything except the #Template template.

Will need to test if the family/chain/set is wrapped in parenthesis like above automatically as another way to detect ABC or CW20.

Yes registered is useful to determine if a template exists. I use this myself in various places.

For example the NeTalk Application wizard checks to see if a bunch of optional templates are available, and if they are offers to add them when creating the app.

In other places, one template might recommend another template, knowing it is available.

It’s not quite what you asked in your original question though.

(post deleted by author)