User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 402,906 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,123 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 1052 | Replies: 2 | Solved
Reply
Join Date: Nov 2006
Posts: 5
Reputation: jgill is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jgill jgill is offline Offline
Newbie Poster

Urgent...Having problem debugging...Need help ASAP!

  #1  
Jan 9th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2006
Location: Near Chicago
Posts: 79
Reputation: nikkiH is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 4
nikkiH's Avatar
nikkiH nikkiH is offline Offline
Junior Poster in Training

Re: Urgent...Having problem debugging...Need help ASAP!

  #2  
Jan 11th, 2007
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.
Last edited by nikkiH : Jan 11th, 2007 at 9:39 am.
Google is your friend. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit http://www.kaelisspace.com/
Reply With Quote  
Join Date: Jan 2007
Posts: 5
Reputation: gintom is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
gintom gintom is offline Offline
Newbie Poster

Re: Urgent...Having problem debugging...Need help ASAP!

  #3  
Jan 13th, 2007
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.
Last edited by gintom : Jan 13th, 2007 at 8:33 pm.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP Forum

All times are GMT -4. The time now is 3:34 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC