` Printed Icetips Article

Icetips Article



Templates: Testing for other populated templates
1999-03-29 -- Lee White
 
Newsgroups: TopSpeed.Topic.Templates

Editors note:  Please note that some lines may wrap in the template code.

Craig,

#RESTRICT
  #FOR(%ActiveTemplate)
    #IF(UPPER(%ActiveTemplate) = 'RPM_STANDARD_RPT(LODESTAR_RPM)')
      #ACCEPT
      #BREAK
    #ENDIF
  #ENDFOR
#ENDRESTRICT

...or...

#ATSTART
  #DECLARE(%RPMExt)
  #SET(%RPMExt,%FALSE)
  #FOR(%ActiveTemplate)
    #IF(UPPER(%ActiveTemplate) = 'RPM_STANDARD_RPT(LODESTAR_RPM)')
      #SET(%RPMExt,%TRUE)
      #BREAK
    #ENDIF
  #ENDFOR
#ENDAT


Of course you'll probably want to replace some text...

  'RPM_STANDARD_RPT(LODESTAR_RPM)'

...so you can find YOUR templates!!


With #RESTRICT your template will only be listed as available when the
condition is true so you don't even have to worry about it.

--

Lee White
Team TopSpeed
Lodestar Software = http://www.CWaddons.com

Craig E Ransom  wrote in message
news:VA.0000068a.0030c8a4@dataferret.compuserve.com...
> Hi All!
>
> I have a situation where I need to check for the presence of TWO other
> remplates because I have to use their features.  I know about REQ() but
> I believe that I can have only ONE of these and I don't particularly
> want to see my template dangling from either of the other two templates
> in the Extensions tree. Ideally, I'd like to test at population time,
> but this may be impossible. Generating an #ERROR at generation time is
> good enough.



Printed April 29, 2024, 3:53 am
This article has been viewed/printed 35113 times.
Google search has resulted in one hit on this article since January 25, 2004.