Two issues I see.
Problem number 1 is My Bad. :-)
You need to remove the ZipCode paramether since it isnt defined in the
page.
ie.
ticketpricing.getPrice(price,discounttype,zipCode)
should be
ticketpricing.getPrice(price,discounttype)
Problem numero B,the SalesTaxStrategy.cfc calls another CFC not included in
the article so you can take it out its there for example.
<cfinvoke component="TaxRates" Method="GetRateByZip" ReturnVariable="thisTaxRate">
Here is an empty example:
<cfcomponent displayname="TaxRate">
<cffunction name="GetRateByZip" access="public" returntype="numeric">
<cfargument name="ZipCode" type="string" required="Yes">
<cfreturn 6>
</cffunction>
</cfcomponent>
It always returns 6 but you can program that internal logic whenever.
Brendan
"David K. McCutcheon" <[EMAIL PROTECTED]>@cfczone.org on
06/09/2003 06:17:58 PM
Please respond to [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
To: <[EMAIL PROTECTED]>
cc:
Subject: RE: [CFCDev] Anyone tried O'Hara's strategy pattern example in
CFDJ
Thanks for the reply Brendan.
I apologize in advance if I'm simply being a moron and missing something
obvious... nevertheless, here's what's happening...
I get the following CF error when it's looping through and outputting
the query. It successfully outputs this much:
--------------------------
Event Original Price Ticket Your Price
Wharton Business Forum $15.00
--------------------------
Then throws the following error:
--------------------------
Error Occurred While Processing Request
Variable ZIPCODE is undefined.
The error occurred in C:\sites\patterns\www\pricingTest.cfm: line 36
34 : <td>#dollarformat(price)#</td>
35 : <td>#discountType#</td>
36 :
<td>#dollarformat(ticketpricing.getPrice(price,discounttype,zipCode))#</
td>
37 : </tr>
38 : </cfoutput>
--------------------------
Shouldn't the value of zipCode that the error above is referring to be
coming from the default value of the ZipCode argument of getPrice(),
which in your example is "19341"? If this is the case, why am I getting
the undefined error?
Thanks.
D
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Brendan O'Hara
Sent: Saturday, June 07, 2003 9:18 PM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] Anyone tried O'Hara's strategy pattern example in
CFDJ
Well what are the errors you are getting?
PS You can download the source code from sys-con.com:
http://www.sys-con.com/coldfusion/source.cfm?id=606
Brendan
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).