# Includes in a source template

**URL:** <https://clarionhub.com/t/includes-in-a-source-template/8952>\
**Category:** questions\
**Tags:** templates\
**Created:** [February 19, 2026, 3:30am UTC](https://clarionhub.com/t/includes-in-a-source-template/8952 "2026-02-19T03:30:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![elextronika](https://clarionhub.com/user_avatar/clarionhub.com/elextronika/32/4045_2.png) [@elextronika](https://clarionhub.com/u/elextronika)\
**Post date:** [February 19, 2026, 3:30am UTC](https://clarionhub.com/t/includes-in-a-source-template/8952/1 "2026-02-19T03:30:58Z")

</div>

Hi there , sorry to bothers you guys , I have hard time trying to add an Include line INCLUDE(‘TKTOURNAMENT077.INC’),ONCE into a Source template I edit the form the solution explorer and inserted and it works but then it gets erase again , is probably something very simple. Couldn’t find any documentation regarding adding includes . I did add one into the global but no luck inside the template . thanks guys .

---

<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:** [February 19, 2026, 3:49am UTC](https://clarionhub.com/t/includes-in-a-source-template/8952/2 "2026-02-19T03:49:24Z")

</div>

If you want to add code to generated modules you need to add it in an appropriate embed point, not in the CLW directly. If you add it to the CLW directly it will be overwritten by the next Generate.

So, view the procedure in the embeditor (ie seeing all the code) and add your include at an appropriate position.

If necessary there are MODULE embed points as well.

---

<div class="post-metadata">

**Author:** ![elextronika](https://clarionhub.com/user_avatar/clarionhub.com/elextronika/32/4045_2.png) [@elextronika](https://clarionhub.com/u/elextronika)\
**Post date:** [February 19, 2026, 4:10am UTC](https://clarionhub.com/t/includes-in-a-source-template/8952/3 "2026-02-19T04:10:57Z")

</div>

![image](https://clarionhub-uploads.s3.dualstack.eu-north-1.amazonaws.com/original/2X/c/c793521aa5d9c67f4cb0d0479237caf3977bdc4b.png)  
I went to add a new procedure and put a; the codes , now I need to add another Include since my code is calling for another procedure but I cant find where to add it

---

<div class="post-metadata">

**Author:** ![LANSRAD](https://clarionhub.com/user_avatar/clarionhub.com/lansrad/32/4519_2.png) [@LANSRAD](https://clarionhub.com/u/LANSRAD)\
**Post date:** [February 19, 2026, 8:19am UTC](https://clarionhub.com/t/includes-in-a-source-template/8952/4 "2026-02-19T08:19:55Z")

</div>

One thing to consider with your screenshot.

Unless the code in your file is not code that would normally be INSIDE the MAP statement, you might be using the wrong embed.

I’d expect it to be something like:

```clarion
  MODULE('SomeModuleName')
SomeProcedureName PROCEDURE() ... (other params here)
   END

```

---

<div class="post-metadata">

**Author:** ![RchdR](https://clarionhub.com/letter_avatar_proxy/v4/letter/r/d78d45/32.png) [@RchdR](https://clarionhub.com/u/RchdR)\
**Post date:** [February 19, 2026, 9:59am UTC](https://clarionhub.com/t/includes-in-a-source-template/8952/5 "2026-02-19T09:59:28Z")

</div>

The code you are pointing to

```clarion
    map
        include('tktournament070.inc')
    end

```

is generated by the template `ABModule.tpw`.

Like @Bruce has said, its best to use one of the built in embeds available when using the AppGen Module view.

This embed looks like a suitable candidate

```clarion
#EMBED(%ModuleDataSection,'Module Data Section'),DATA

```

something like

```clarion
    Map !your handcoded map structure because you can have more than one map structure.
        include('path\to\myclassfile.inc') ! exclude the path if it can be found in your RED file.
    End !End of my handcoded map structure

```

I’m assuming you only want your class to have the scope the module provides and not global scope?  
For more info, see [class\_object\_declaration\_.htm [Clarion Community Help]](https://clarion.help/doku.php?id=class_object_declaration_.htm)

> Scoping Issues
> 
> The scope of an object is dependent upon where it is declared. Generally, a declared object comes into scope at the CODE statement following its declaration and goes out of scope at the end of the related executable code section. A dynamically instantiated object (using NEW) shares the scope of the executable code section in which it is instantiated.
> 
> An Object declared:
> 
> ·As Global data is in scope throughout the application.
> 
> ·As Module data is in scope throughout the module.
> 
> ·As Local data is in scope only in the procedure, except …

IMO this should read…

> ·As Module data is in scope throughout the module and procedures called from the module.

---

<div class="post-metadata">

**Author:** ![seanh](https://clarionhub.com/letter_avatar_proxy/v4/letter/s/4af34b/32.png) [@seanh](https://clarionhub.com/u/seanh)\
**Post date:** [February 19, 2026, 11:04pm UTC](https://clarionhub.com/t/includes-in-a-source-template/8952/6 "2026-02-19T23:04:16Z")

</div>

Note that you can have multiple MAP sections. You don’t have to have just the one
