For Programmers: Free Programming Magazines  


Home > Archive > Clarion > July 2006 > How To Apply An Extension Template Only To Certain Procedures in APPLICATION clause









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How To Apply An Extension Template Only To Certain Procedures in APPLICATION clause
Suntower

2006-07-14, 6:55 pm

I have an extension template that works on many reports in a given
module
like so...

#EXTENSION (ReportGetControls, 'Get Report Controls'), PROCEDURE,
REPORT,
FIRST, REQ(ReportOptionsWindow(SATemplates))

OK, I thought I could create a global extension template and use that
to
populate every report procedure that contained the other extension
ReportOptionsWindow (in the above REQ clause).

#EXTENSION (ReportGetControlsGlobal, 'Include Get Report Controls
Global'),
DESCRIPTION('Global Include For Get Report Controls'),
APPLICATION(ReportGetControls)
#DISPLAY('That's it!')

Is there a way to get the global extension to -only- add
ReportGetReportControls to procedures IF they contain the extension
template
ReportOptionsWindow ?

----I tried using #RESTRICT like so...

#EXTENSION (ReportGetControlsGlobal, 'Include Get Report Controls
Global'),
DESCRIPTION('Global Include For Get Report Controls'),
APPLICATION(ReportGetControls)
#DISPLAY('Placeholder')

#EXTENSION (ReportGetControls, 'Get Report Controls'), PROCEDURE,
REPORT,
FIRST
#RESTRICT
#FOR(%ActiveTemplate),WHERE(%ActiveTempl
ate='ReportOptionsWindow(SATemplates)')
#ACCEPT
#ENDFOR
#REJECT
#ENDRESTRICT
#PROMPT ('Include Code?', CHECK), %IncludeCode
#ATSTART
#DECLARE(%MyVarName)
#DECLARE(%xCounter)
#ENDAT

.....I thought that what would happen, when I attached
ReportGetControlsGlobal
to the Global Extensions list, would be that ReportGetControls would be

attached to all procedures BUT that no code would be generated unless
ReportOptionsWindow(SATemplates) was one of the templates in the
procedures.

But this did not happen. Instead, the code was inserted into every
procedure. What did I do wrong?

Thanks!

---JC

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com