Hi Everyone,
Sorry, in my previous post edition, the template extension was dependent on a Joliciel_TemplateSet. I’ve modified the extension to be a template on its own can be used. Like I’m saying the error left that I’m investigating is on template errors.
The purpose here is to create a template extension with a MULTI attribute handling Global Object in its own tree within the Global embeds of the IDE like the File Manager, Fuzzy Manager, etc.….
I’m almost there; I’ve been able to create the extension where all instances are shown within the Global Embed. The code is generated with template errors caused mostly by %ClassItem symbols and instances of %ApplicationTemplateInstance. The code is generated entirely even with these errors. I believe the errors are dependent to the IDE itself. The program compiles without errors. I find this template extension must be perfectly created otherwise when there is changed at that level to the template extension the program will not load. Meaning I need to understand the process of this template extension. Below you’ll find more notes regarding the objective.
Here’s what is going on, the Global Embed Object of a class with multiple instances of the same class is working. Some test was done on five virtual child classes declared manually. I say this because, when %GlobalObject is set to “NO” the Class Item field is DISABLED. Meaning, one template for one class, this is not what I want to do. I’ve created the GlobalEmbedObject extension template child with a set of templates with the MULTI attribute on. The same extension can be reused.
The Global Embed shown all the virtual class in their own branch. The generated code of the applications was done successfully with five virtual child classes. Two of them had two instances of the same class. It generated with errors caused by %ClassItem symbol.
Here’re the template errors posted.
GEN: ASSERT: %ClassItem has no instance, jcL1 jcBase
GEN: ASSERT: %SetClassItem, instances not found: GlobalEmbedObject—[] for ClassItem:
TPL: (ABOOP.tpw) Error: Symbol %DefaultBaseClassType has no instance—C:\Clarion11\template\win\ABOOP.tpw:352
TPL: (ABOOP.tpw) Error: Symbol %ThisObjectName has no instance—C:\Clarion11\template\win\ABOOP.tpw:354.3
TPL: (ABOOP.tpw) Error: Symbol %ActualDefaultBaseClassType has no instance—C:\Clarion11\template\win\ABOOP.tpw:356
It seems that #CALL (%SetClassItem [ABC], “jc” & %ApplicationTemplateInstance). If this is not done the tree within the global embed is not shown. Maybe this is where I’m mistaken. Well, the application did compile without any error and run nicely.
#TEMPLATE(JoliClassGlobalManager,'Joliciel Class Global Manager Class Wrapper'),FAMILY('ABC')
#!------------------------------------------------------------------------------
#EXTENSION(JolicielClassManagerGlobalInstance,'Joliciel Class Global Manager instance'),MULTI,APPLICATION,DESCRIPTION('GlobalEmbedObject - ' & %ThisObjectName & ' An Instance Of: ' & 'jcBase' )
#!------------------------------------------------------------------------------
#INSERT(%JolicielOOPPrompts(Joliciel_TemplateSets))
#PREPARE
#CALL (%ReadABCFiles(ABC))
#DECLARE(%GlobalObjectAssign)
#SET(%GlobalObjectAssign,'NO')
#SET(%GlobalObject,%GlobalObjectAssign)
#CALL(%SetClassDefaults(ABC),'jc','jc','jcBase')
#SET (%UseDefaultABCBaseClass,%True)
#SET (%UseABCBaseClass,%False)
#ENDPREPARE
#ATSTART
#CALL (%ReadABCFiles(ABC))
#CALL (%SetClassItem(ABC), 'jc' & %ApplicationTemplateInstance)
#CALL (%SetClassDefaults(ABC), 'jc','jc', 'jcBase')
#ENDAT
#SHEET
#TAB('Class')
#WITH(%ClassItem, 'jc' & %ApplicationTemplateInstance)
#INSERT(%GlobalClassPrompts(ABC))
#ENDWITH
#ENDTAB
#ENDSHEET
#AT (%GatherObjects)
#CALL (%ReadABCFiles(ABC))
#CALL(%AddObjectList(ABC),'jc') #!Add the template object
#ADD (%ObjectList, %ThisObjectName)
#SET (%ObjectListType,'jcBase')
#ENDAT
#AT (%GlobalData)
#CALL (%SetClassItem(ABC), 'jc' & %ApplicationTemplateInstance)
#INSERT (%GenerateClassDefinition(ABC), %ClassLines)
#ENDAT
#AT (%ProgramProcedures)
#CALL (%GenerateVirtuals(ABC), 'jc' & %ApplicationTemplateInstance, 'Joliciel Global Objects|Abc Objects| ' & %ApplicationTemplateInstanceDescription & '(' & %ThisObjectName & ')' & %ApplicationTemplateInstance, '%EmbedVirtuals(Joliciel_TemplateSets)')
#ENDAT
#AT (%JoliClassManagerMethodCodeSection,%ApplicationTemplateInstance),PRIORITY(5000),DESCRIPTION('Parent Call'),WHERE(%ParentCallValid())
#CALL (%GenerateParentCall(ABC))
#ENDAT
#!
#! ----- REQUIRED GROUPS -----
#!
#!
#!
#GROUP (%EmbedVirtuals, %TreeText, %DataText, %CodeText)
#EMBED (%JoliClassManagerMethodDataSection, 'Joliciel Class Manager Method Data Section'),%ApplicationTemplateInstance,%pClassMethod,%pClassMethodPrototype,LABEL,DATA,TREE(%TreeText & %DataText)
#?CODE
#EMBED (%JoliClassManagerMethodCodeSection, 'Joliciel Class Manager Method Code Section'),%ApplicationTemplateInstance,%pClassMethod,%pClassMethodPrototype,TREE(%TreeText & %CodeText)
#!
#!
#GROUP(%ParentCallValid),AUTO
#DECLARE(%RVal)
#CALL(%ParentCallValid(ABC)),%RVal
#RETURN(%RVal)
#!
#!
#GROUP(%JolicielOOPPrompts)
#BOXED,HIDE
#INSERT(%OOPHiddenPrompts)
#ENDBOXED
#INSERT(%OOPPrompts(ABC))
Thank you,
Robert