Extension class methods at %LocalProcedures: duplicated when two procedures in a module use it?

Applies to: an extension template reported in April 2016; the thread mentions a Clarion10 template folder. Chain not named.

Problem

A procedure extension declares a CLASS at #AT(%DataSection) and its methods at #AT(%LocalProcedures). When the extension was added to several procedures in one module, the poster feared the methods were duplicated and asked how to generate them only once per module.

Solution

  1. The class declared in %DataSection is local to its procedure, so each procedure needs its own instance and its own method declarations at %LocalProcedures. Leaving them out causes errors.
  2. A plain Clarion example in the thread, two procedures in one PROGRAM each declaring LocClass,type with LocClass.method, compiled and ran without errors.
  3. The poster then confirmed the same with his extension: the errors he had seen were spurious ones, raised for something the compiler could detect but not identify in the source.
  4. Ideas offered before that, which the poster did not need: move the class to an INCLUDE with ,ONCE in a global embed and give each instance a name built from %ActiveTemplateInstance; or split into two dependent templates.

Caveats

  • The thread does not say what the real error was; only that it was not the duplicated methods.
  • One poster guessed, untested, that the link map prefixes local methods with the parent procedure name.
  • The module name is not available to the extension through any symbol named in the thread.

Today (2026)

Likely still holds, as it follows from local-scope rules; not re-tested on a current build.

Sources: Kevin D. (Apr 2016, the question), Lee W. (Apr 2016), Carl S. (Apr 2016, Jun 2016), Graham D. (Apr 2016) in softvelocity.clarion.templates.