How to make a template set a derived FileManager class for all files

Applies to: ABC template chain; Clarion version not named in the thread (2009 posts).

Problem

A poster had a class (external .inc and .clw in the libsrc folder) that derives the FileManager OPEN method. Setting it on the Global classes tab worked. The poster wanted a template to tell Clarion to use the derived class, to make it easier to apply, without editing the shipped templates.

Solution

  1. Put a #ATSTART section in your own template that loops the files and sets the class item for each one. The poster who asked reported that this second form "works perfectly":
#ATSTART
#FOR(%FILE)
#CALL(%SetClassItem(ABC),'FileManager:' & %FILE)
#SET(%UseDefaultABCBaseClass,%False)
#SET(%UseABCBaseClass,%True)
#SET(%ABCBaseClass,'YourFileManager')
#ENDFOR
#ENDAT
  1. Alternative that the answerer said also works, in an application extension: #EXTENSION(CEChangeFileManager,'Change all filemanagers'),APPLICATION with #ATSTART, #Set(%FileManagerType,'YourFileManager'), #EndAT.
  2. The answerer preferred the per-file loop because it is an individual file override and can be tuned for particular files.
  3. A third reply: any embed causes the object to be derived automatically, so a global extension template that embeds your Open code in the FileManagers gives the same effect without a new inc and clw. It pointed to the ABCFree template (FileUseDescriptionInErrors) as an example.

Caveats

  • The values are altered from your own template; the shipped ABOOP.TPW (group %CommonClassPrompts) did not need to be edited.
  • The first idea, a utility template, was tried by the answerer in another setting and its values were present for only one generation.
  • The poster did not report trying the embed approach.

Today (2026)

The symbols come from the ABC templates of that time; likely still the right place to look, but not re-tested on a current build.

Sources: Charles E. (Mar 2009, the question), Bjarne H. (Mar 2009), Carl S. (Mar 2009) in softvelocity.clarion.templates.