Adding the same custom code to about 50 update procedures in one step

Applies to: posted in the Clarion 6 group; the thread does not name a template chain.

Problem

An app had about 50 update (FORM) procedures. The poster wanted to add a few lines of custom code to all of them, priming some fields on a condition, in one go. A code template would still have to be added to each procedure by hand.

Solution

  1. Write a global template, an #EXTENSION, that inserts the code into all or some of the procedures. Look up #EXTENSION in the help.
  2. In it, place the code with an #AT statement that is restricted by procedure template:
#AT(%WindowManagerMethodCodeSection,'Init','(),BYTE'),PRIORITY(6001),WHERE(%ProcedureTemplate='XXX')
  your code here
  1. Replace XXX with the procedure template you want to reach, for example 'window' or 'report'. Other embed points can be chosen the same way.
  2. Alternative: a ready-made $50 third-party template, Conductor, does this through a global extension.

Caveats

  • The #AT snippet is offered as a start ("this should get you started"), not a finished template.
  • The original poster answered that the advice "sounds like it is exactly what I needed" but did not report the finished result.
  • The thread does not say which of the two routes he took.

Today (2026)

The #AT with WHERE restriction is template language and is likely unchanged on current Clarion; not re-tested. The third-party product named is from 2007; its current status is not known.

Sources: Arthur K. (Sep 2007, the question), Peter H., Paul H. (Sep 2007) in softvelocity.public.clarion6.