> ColdFusion comparison statements (CFIF, etc.) support the XOR joiner 
> between clauses. This is used as such:
> clause1 XOR clause2
> This says that either clause1 or clause2 has to be true for the 
> statement to be true. If both are true or both are false, then the 
> entire statement is false. My question is: can anyone think of a real 
> world example where you would need a statement like this?
> 
We use XOR in a statement where both a date and a date selection type is 
required.  If one is entered and not the other, then the user is prompted to 
enter both.  If both or neither are entered, then the search proceeds with 
whatever criteria it has.

<cfif b_date_entered XOR b_date_sel_entered>
        <script language="javascript">
                window.alert('You must enter a date restriction and date(s).');
                history.back();
        </script>
        <cfabort>
</cfif>

Tim 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349856
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to