# How to know the Family() of a Template

**URL:** <https://clarionhub.com/t/how-to-know-the-family-of-a-template/5855>\
**Category:** uncategorized\
**Tags:** templates\
**Created:** [January 20, 2023, 11:30pm UTC](https://clarionhub.com/t/how-to-know-the-family-of-a-template/5855 "2023-01-20T23:30:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon23294430](https://clarionhub.com/user_avatar/clarionhub.com/anon23294430/32/3829_2.png) [@anon23294430](https://clarionhub.com/u/anon23294430)\
**Post date:** [January 20, 2023, 11:30pm UTC](https://clarionhub.com/t/how-to-know-the-family-of-a-template/5855/1 "2023-01-20T23:30:01Z")

</div>

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?

TIA

Edit.  
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.

---

<div class="post-metadata">

**Author:** ![Bruce](https://clarionhub.com/letter_avatar_proxy/v4/letter/b/ccd318/32.png) [@Bruce](https://clarionhub.com/u/Bruce)\
**Post date:** [January 21, 2023, 12:41am UTC](https://clarionhub.com/t/how-to-know-the-family-of-a-template/5855/2 "2023-01-21T00:41:43Z")

</div>

> [@anon23294430](#):
>
> but there doesnt appear to be any symbol in which to extract this info.

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.)

---

<div class="post-metadata">

**Author:** ![anon23294430](https://clarionhub.com/user_avatar/clarionhub.com/anon23294430/32/3829_2.png) [@anon23294430](https://clarionhub.com/u/anon23294430)\
**Post date:** [January 21, 2023, 12:50am UTC](https://clarionhub.com/t/how-to-know-the-family-of-a-template/5855/3 "2023-01-21T00:50:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bruce](https://clarionhub.com/letter_avatar_proxy/v4/letter/b/ccd318/32.png) [@Bruce](https://clarionhub.com/u/Bruce)\
**Post date:** [January 21, 2023, 2:14am UTC](https://clarionhub.com/t/how-to-know-the-family-of-a-template/5855/4 "2023-01-21T02:14:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anon23294430](https://clarionhub.com/user_avatar/clarionhub.com/anon23294430/32/3829_2.png) [@anon23294430](https://clarionhub.com/u/anon23294430)\
**Post date:** [January 21, 2023, 2:27am UTC](https://clarionhub.com/t/how-to-know-the-family-of-a-template/5855/5 "2023-01-21T02:27:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon23294430](https://clarionhub.com/user_avatar/clarionhub.com/anon23294430/32/3829_2.png) [@anon23294430](https://clarionhub.com/u/anon23294430)\
**Post date:** [January 27, 2023, 2:00am UTC](https://clarionhub.com/t/how-to-know-the-family-of-a-template/5855/6 "2023-01-27T02:00:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bruce](https://clarionhub.com/letter_avatar_proxy/v4/letter/b/ccd318/32.png) [@Bruce](https://clarionhub.com/u/Bruce)\
**Post date:** [January 27, 2023, 2:22am UTC](https://clarionhub.com/t/how-to-know-the-family-of-a-template/5855/7 "2023-01-27T02:22:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon23294430](https://clarionhub.com/user_avatar/clarionhub.com/anon23294430/32/3829_2.png) [@anon23294430](https://clarionhub.com/u/anon23294430)\
**Post date:** [January 27, 2023, 7:12am UTC](https://clarionhub.com/t/how-to-know-the-family-of-a-template/5855/8 "2023-01-27T07:12:47Z")

</div>

(post deleted by author)
