Hello,
To start with here is the code:


Public Function Paymentget (s12MoRate)
strCompanyCode = objXML.selectSingleNode("policy/companyCode").text
strState = objXML.selectSingleNode("policy/insured/state").text

set rsDownPayment = getCache("down_payment")

dim tempPremium, totalTaxes

totalTaxes = 0
tempPremium = s12MoRate

' calculate the taxes so they can be front loaded in the payment schedule
dim TaxCov
for each TaxCov in objXml.selectNodes("//coverage[manOptSwitch='T']")
taxRate = cdbl(TaxCov.selectSingleNode("../rate/coverage[@covCode = '" & TaxCov.selectSingleNode("coverageCode").text & "']/twelveMonth").text)
tempPremium = tempPremium - taxRate
totalTaxes = totalTaxes + taxRate
next

' CLR - new filter as of 12/25/02 for new payplan table structure
set rsDownPayment = applyFilterAndReloadRecordset(rsDownPayment, "a01_company = '" & objLogic.Company & "' or a01_company = '99'")
set rsDownPayment = applyFilterAndReloadRecordset(rsDownPayment, "a02_state = '" & objLogic.BikeState & "' or a02_state = 'ZZ'")
set rsDownPayment = applyFilterAndReloadRecordset(rsDownPayment, "min_premium <= " & tempPremium & " and b80_userline = '" & objLogic.userline & "' and profile = '" & objLogic.profile & "'")

dim minimumPct
dim payment
dim installmentfee

' initialize payment percentage, amount, and fee to be full pay parameters as default
minimumPct = 1
payment = tempPremium
installmentfee = 0
' now loop through available plans, and get the minimum that they can get in the policy
while not rsDownPayment.eof

if cdbl(rsDownPayment("m84_instpct")) < cdbl(minimumPct) then

minimumPct = cdbl(rsDownPayment("m84_instpct"))
payment = cdbl(rsDownPayment("m84_instpct")) * tempPremium
installmentfee = rsDownPayment("first_installment_fee")

end if
rsDownPayment.MoveNext
wend

Paymentget = cdbl(payment) + cdbl(installmentFee) + cdbl(totalTaxes)

End Function


I have a few questions for the asp guru’s out there:
Just a brief summary…this function works fine until the value of s12MoRate is less than 999. If it is more than 999 than the value for the Payment (s12MoRate) is 0, which is not right.
I am not good at asp & was wondering on how to debug the application starting from checking what value does s12MoRate has??
Than how do I check the value for the following?
set rsDownPayment = applyFilterAndReloadRecordset(rsDownPayment, "a01_company = '" & objLogic.Company & "' or a01_company = '99'")
set rsDownPayment = applyFilterAndReloadRecordset(rsDownPayment, "a02_state = '" & objLogic.BikeState & "' or a02_state = 'ZZ'")
set rsDownPayment = applyFilterAndReloadRecordset(rsDownPayment, "min_premium <= " & tempPremium & " and b80_userline = '" & objLogic.userline & "' and profile = '" & objLogic.profile & "'")
Than check does the while loop execute and what value does payment gets (payment = cdbl(rsDownPayment("m84_instpct")) * tempPremium)??


Any help is appreciated ASAP…thanks a lot for yr time…bye

I have never managed to find a good way to debug classic ASP, and always end up with either text to a log file, or response.write all over the place for tracing.

Just a quick question:

What software are you using to write the ASP code in?

Edit:

If you are using MicroSoft Visual studio 6 - Visual Interdev

But there are a few settings that you need to do first.

1. In your IIS right click on the Virtual Directory of your site and click properties.
2. Then change the application protection from Medium(Pooled) --> Low(IIS Process)
3. Click the "Configuration" button next to the drop down.
4. Click on the "debugging" tab and tick "Enable ASP Server-Side scripting debugging" and "Enable ASP Client-Side scripting debugging" and click apply.
5. in your browser go to Tools --> Internet Options --> Adavanced --> and make sure that the following are NOT! ticked Disable Script Debugging.

Close down any browsers and reopen if an error occurs a message will appear asking what of the 3 above debuggers to use (if installed) choose one and click yes.

This will then show you the problem/error within in your code by highlighting and show a message of the error. It will also allow to see what value your varaibles have.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.