Given that you can do code such as the following, I'd have to say that CF
doesn't include the file until it actually gets to the line:

<CFIF thisFlag>
  <CFINCLUDE TEMPLATE="#SomethingDynamic#.cfm">
</CFIF>

Tangentially, I've also noticed that if I do CFModule calls with static
filenames that don't exist, I get compile-time errors.  But, if the
filenames are dynamic then I don't get errors until run-time.  That is:

<CFSET FileName="foo.cfm"><!--- does not exist! --->
<CFMODULE TEMPLATE="foo.cfm"><!--- compile-time error --->
<CFMODULE TEMPLATE="#FileName#"><!--- run-time error --->

I'm guessing they do a bit of optimization in there somewhere.  Where's a
CFS programmer when you need one?  :)

-Rick

-----Original Message-----
From: Mike Amburn [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 03, 2000 11:09 AM
To: Cf-Talk
Subject: CFINCLUDE... compiler question


take the following code:

<cfif thisFlag>
   <cfinclude template="thisFile.cfm">
</cfif>

Will ColdFusion evaluate the expression first before it includes the
file -OR- will it include the file before it evaluates the expression?

in other words, does CF say "ok, thisFlag is false, so i won't evaluate
what's in the include file" or will it say "before i look at this, i need to
include everything first"?

thanx for any response
mike

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to