Applies to: posted in the group softvelocity.clarion.templates in 2018; version and template chain not named.
Problem
The poster wanted to check in template language whether a control in a window definition has its help filled in, and when empty generate code that sets it, such as %Control{PROP:Hlp} = "yadayada". He found no template statement for the check. The obvious form was suggested by another poster:
#FOR(%Control)
#IF(%Control{PROP:Hlp}='')
...
The template language did not accept #IF(%Control{PROP:Hlp}='').
Solution
Test the control's statement text instead, with EXTRACT on %ControlStatement:
#IF(EXTRACT(%ControlStatement,'HLP') = '')
%Control{PROP:Hlp} = "yadayada"
#ENDIF
The poster answered "works perfect".
Caveats
- The suggestion came from a poster who had not tested it; the original asker then confirmed it.
- It looks at the control declaration's HLP attribute, not at a run-time property.
- Run it inside the usual #FOR(%Control) loop.
Today (2026)
Not re-tested. EXTRACT on the control statement is plain template language and probably still works on current builds.
Sources: Gunter S. (Jan 2018, the question), Peter H., Mike D. (Jan 2018) in softvelocity.clarion.templates.