ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!

Download and Activate to enter!
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.

Download to Enter | Contest Rules

Learn More!

Tutorials | Forums

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 2nd, 2004, 11:58 AM
javiwankenobi javiwankenobi is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 58 javiwankenobi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 42 sec
Reputation Power: 9
Angry Overflow when trying to divide :(

Hey, thanks for all of your helping in the past.....now im stuck on this one. Ok so this is what i have to do


F.E. = T - t
------ x100
T
where T = is the last operation's timing
t = is the first operation's timing

So i coded it all in one line like this:

Code:
Session("feugene") = ((Session("fop10")-Session("fop1"))/Session("fop10"))*100


And that returned "overflow" error... so i checked once and again and i couldnt find a mistake on a parenthesis or nothing like that. So i ended up doing it all step by step like this:

Code:
Session("feugene") = Session("fop10")-Session("fop1")
Session("feugene") = Session("feugene")/Session("fop10")
Session("feugene") = Session("feugene")*100 


and it's still saying i have an error on the line that refers to the division. I am using 'double' values on the inputs.. and i also tried to use the cdbl function before each variable and it wont work either. Does anyone have an idea of what's going on? Sorry if dumb post, but this is driving me nuts.. thanks

Reply With Quote
  #2  
Old April 2nd, 2004, 02:06 PM
ASP-Hosting.ca ASP-Hosting.ca is offline
Need hosting? I can help.
ASP Free Novice (500 - 999 posts)
 
Join Date: Sep 2003
Posts: 826 ASP-Hosting.ca User rank is Private First Class (20 - 50 Reputation Level)ASP-Hosting.ca User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 17 h 50 m 37 sec
Reputation Power: 9
Print the value of Session("fop10") with Response.Write and make sure it's not 0.

Reply With Quote
  #3  
Old April 2nd, 2004, 02:15 PM
spungebob spungebob is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Dover
Posts: 128 spungebob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 39 sec
Reputation Power: 9
Smile Can not devide by zero!

Here is what I would try
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 7.0">
</HEAD>
<BODY>
<%

Session("fop1") = 0
Session("fop10") = -1
if Session("fop10") = 0 then
'can not divide by zero
session("feugene") = 0
Else
Session("feugene") = cdouble(Session("fop10"))-cdouble(Session("fop1"))
Session("feugene") = cdouble(Session("feugene"))/cdouble(Session("fop10"))
Session("feugene") = cdouble(Session("feugene"))*100
end if
Response.write session("feugene")
%>
</BODY>
</HTML>
<%
Public Function CDouble(value)
CDouble = 0.0

If VarType(value) = vbBoolean Then
If value Then
CDouble = 1.0
End If

Exit Function
End If

On Error Resume Next
CDouble = CDbl(value)
End Function
%>

Bob@lyrex.com

Reply With Quote
  #4  
Old April 2nd, 2004, 03:27 PM
javiwankenobi javiwankenobi is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 58 javiwankenobi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 42 sec
Reputation Power: 9
Thanks for your reply spungebob..
i capture the values of the variables with textfields, so i put the inputs
and none of the inputs are 0...

i still keep getting that error.. i feel like the dumbest person in the world!!! =(

Reply With Quote
  #5  
Old February 15th, 2005, 01:43 PM
cainechow cainechow is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 1 cainechow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 45 sec
Reputation Power: 0
I would like to give this thread a bump to the top because I am also having this problem.

For me, I have 2 variables which are sumations and have the following code:

Code:
  
dWinchCatTotalShiftsWorked = cdbl(dWinchCatTotalShiftsWorked) + cdbl(dValue) 
dWinchCatUtilizationTotalShiftsAvailable = cdbl(dWinchCatUtilizationTotalShiftsAvailable) + cdbl(rsDetails("ShiftsAvailable")) 


When I use response.write on these variables I get 6 and 8 respectively. When I response.write the TypeName of these variables, I get the value double for both.

Now, when I divide dWinchCatTotalShiftsWorked by dWinchCatUtilizationTotalShiftsAvailable as in the following:

Code:
Response.Write(dWinchCatTotalShiftsWorked/dWinchCatUtilizationTotalShiftsAvailable)
Response.Write(6/8)


I get the Microsoft VBScript runtime (0x800A0006) Overflow error.

The second statement works just fine and returns 0.75

Now how is it that division using the variables causes an overflow error? a CDbl should easily handle a value of 0.75

Ponderous man. Really ponderous.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Overflow when trying to divide :(


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 



Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 2 - Follow our Sitemap