PilotCart Support Forum
PilotCart Support Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snippets
 ASP
 ASP Function
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

manu_learning
Passenger

India
6 Posts

Posted - 10/17/2003 :  8:53:56 PM  Show Profile  Reply with Quote
Hi,
I have made a ASP function that round the given figure.The Function is as follows:

Function intRound(intField)
temp = intField mod 5
If temp <> 0 then
intField = intField + (5 - temp)
End if
End Function

Later in the code I am calling this function as:

intChildFare_rs = intRound(intChildFare_rs)
Response.write intChildFare_rs


But i am not getting the value of "intChildFare_rs". Pls tell me if there is any mistake or any problem.
Thanks
Regards
Manish


A Student who want to learn something and need help for that.

zwemkec
Moderator

USA
713 Posts

Posted - 10/21/2003 :  09:58:24 AM  Show Profile  Visit zwemkec's Homepage  Reply with Quote
Don't reinvent the wheel.

If IsNumeric(intChildFare_rs) Then intChildFare_rs = Round(intChildFare_rs)
Response.Write intChildFare_rs


<%
Chris Zwemke
zwemkec @ aspilot . com
%>
Go to Top of Page

wongxiening
Passenger

Singapore
1 Posts

Posted - 03/31/2007 :  08:36:34 AM  Show Profile  Reply with Quote
I think you need to inculde a return.



Function intRound(intField)
temp = intField mod 5
If temp <> 0 then
intField = intField + (5 - temp)
End if
return intField
End Function
Go to Top of Page

zwemkec
Moderator

USA
713 Posts

Posted - 10/08/2007 :  10:53:39 AM  Show Profile  Visit zwemkec's Homepage  Reply with Quote
Not in VBScript you don't. You don't use the return keyword, you use the function name

Function intRound(intField)
temp = intField mod 5
If temp <> 0 then
intField = intField + (5 - temp)
End if
intRound = intField
End Function


<%
Chris Zwemke
chris @ scarabmedia . com
www.pilotcart.com
%>
Go to Top of Page
   Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
PilotCart Support Forum © 2008 Spliethof Inc dba PilotCart.com Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.06