# Template Question Regarding Global Includes

**URL:** <https://clarionhub.com/t/template-question-regarding-global-includes/6965>\
**Category:** questions\
**Tags:** templates\
**Created:** [February 7, 2024, 1:40pm UTC](https://clarionhub.com/t/template-question-regarding-global-includes/6965 "2024-02-07T13:40:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![donridley](https://clarionhub.com/user_avatar/clarionhub.com/donridley/32/1459_2.png) [@donridley](https://clarionhub.com/u/donridley)\
**Post date:** [February 7, 2024, 1:40pm UTC](https://clarionhub.com/t/template-question-regarding-global-includes/6965/1 "2024-02-07T13:40:40Z")

</div>

Good Day Everyone!

Question about Templates

I know how to add an Include file in %AfterGlobalIncludes.

However, how can I check if an Include file is already "included?"

Thank you!

---

<div class="post-metadata">

**Author:** ![Rick\_UpperPark](https://clarionhub.com/user_avatar/clarionhub.com/rick_upperpark/32/346_2.png) [@Rick\_UpperPark](https://clarionhub.com/u/Rick_UpperPark)\
**Post date:** [February 7, 2024, 2:36pm UTC](https://clarionhub.com/t/template-question-regarding-global-includes/6965/2 "2024-02-07T14:36:40Z")

</div>

Hi Don,  
in #AT(%BeforeGenerateApplication) using this logic

#ADD(%GlobalIncludeList,‘ShThread.inc’)

The templates will handle only generating the INCLUDE statement once for you.

---

<div class="post-metadata">

**Author:** ![Rick\_UpperPark](https://clarionhub.com/user_avatar/clarionhub.com/rick_upperpark/32/346_2.png) [@Rick\_UpperPark](https://clarionhub.com/u/Rick_UpperPark)\
**Post date:** [February 7, 2024, 3:32pm UTC](https://clarionhub.com/t/template-question-regarding-global-includes/6965/3 "2024-02-07T15:32:57Z")

</div>

~~Actually, looking at the ABC templates it does **not** do anything to check if the file is already in the list. I was always under the impression that it did.~~

This is incorrect. See posts below.

---

<div class="post-metadata">

**Author:** ![Graham\_Dawson](https://clarionhub.com/user_avatar/clarionhub.com/graham_dawson/32/1331_2.png) [@Graham\_Dawson](https://clarionhub.com/u/Graham_Dawson)\
**Post date:** [February 7, 2024, 3:59pm UTC](https://clarionhub.com/t/template-question-regarding-global-includes/6965/4 "2024-02-07T15:59:46Z")

</div>

Hi Rick,

Isn’t %GlobalIncludeList multivalued and UNIQUE and both Clarion and ABC have code like this…

#FOR(%GlobalIncludeList)  
INCLUDE(‘%(UPPER(CLIP(%GlobalIncludeList)))’),ONCE  
#ENDFOR

---

<div class="post-metadata">

**Author:** ![Rick\_UpperPark](https://clarionhub.com/user_avatar/clarionhub.com/rick_upperpark/32/346_2.png) [@Rick\_UpperPark](https://clarionhub.com/u/Rick_UpperPark)\
**Post date:** [February 7, 2024, 4:27pm UTC](https://clarionhub.com/t/template-question-regarding-global-includes/6965/5 "2024-02-07T16:27:19Z")

</div>

Oops, you’re right it is UNIQUE. Clearly I should pay more attention before I post.  
I thought it took care of it. I was right but then 2nd guessed myself, oh well.  
Thanks, Graham.
