Template code from #CALL or #INSERT is generated at column 3, not column 1

Applies to: posted in the templates group (moved there from the Clarion 10 group); ABC application.

Problem

The poster wanted a debug line at column 1 inside the generated WindowManager Init method:

#AT(%WindowManagerMethodCodeSection,'Init','(),BYTE'),PRIORITY(450)
#CALL(%SomeGroup)
#ENDAT
#GROUP(%SomeGroup)
? SomeFunction('Some text')

The documentation says #CALL keeps the indentation and source in column 1 is generated into column 1, yet the line came out at column 3. #INSERT(%SomeGroup),NOINDENT (and a ROUTINE attempt) also produced column 3.

Solution

  1. In the group, save the current output indent, remove it, write the line, and restore it:

    #GROUP(%SomeGroup)
    #EQUATE(%SaveOutputIndent, %OutputIndent)
    #INDENT(-%OutputIndent)
    ? SomeFunction('Some text')
    #INDENT(%SaveOutputIndent)
    
  2. The responder credited this trick to a 2009 post in the same group, "#code template and column one".

Caveats

  • Both of the poster's first tries (NOINDENT, ROUTINE) still gave column 3, so the INDENT pair is what to use.
  • The poster thanked the responder; he did not state the generated result, though no one contradicted the answer.

Today (2026)

Likely unchanged, as #INDENT and %OutputIndent are part of the template language; not re-tested.

Sources: Sergio M. (Feb 2019, the question), Graham D. (Feb 2019), Geoff B., Mike H. (Mar 2019) in softvelocity.clarion.templates.