ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

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 Dev Shed Forums Sponsor:
  #1  
Old December 12th, 2003, 08:07 AM
seb835 seb835 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: UK, London
Posts: 95 seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 36 m 11 sec
Reputation Power: 6
Why doesnt "Cint" work?

Hi, im trying to round a floating point number to an integer using this ASP page:

Code:
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include virtual="/adovbs.inc"-->
<!--#include file="dataConnect.asp"-->

<%

Cint("43.3")

%>

<html>

<p>Hello</p>

</body>

</html>


And for some reason this does not work, and i get this error message:


Microsoft VBScript runtime error '800a01ca'

Variable uses an Automation type not supported in vbscript: 'Cint'

/atktBook_06.asp, line 8


Can anyone help me wit this please?
Many thanks
-seb

Reply With Quote
  #2  
Old December 12th, 2003, 10:12 AM
WisconsinGuy's Avatar
WisconsinGuy WisconsinGuy is offline
I thank you very little
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2003
Location: Milwaukee, WI
Posts: 1,028 WisconsinGuy User rank is Corporal (100 - 500 Reputation Level)WisconsinGuy User rank is Corporal (100 - 500 Reputation Level)WisconsinGuy User rank is Corporal (100 - 500 Reputation Level)WisconsinGuy User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 35 m 41 sec
Reputation Power: 9
cInt is used to convert a string to an Integer. And it only works when the string is a valid integer. Not sure if VBScript has a math round feature but I know JavaScript does, just search the forums for Math.Round()

Good Luck!

Reply With Quote
  #3  
Old December 12th, 2003, 03:17 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
OK what's wrong here...

<%

Cint("43.3")

%>


Do you see it yet?

Cint() definition:
Returns an expression that has been converted to a Variant of subtype Integer.


That means that it returns something but where are you putting that return value ???

Try this:
<%
Dim lngMyReturnedValue

lngMyReturnedValue = Cint("43.3")


Response.Write "The Cint() of 43.3 is : " & lngMyReturnedValue
%>

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #4  
Old December 12th, 2003, 06:06 PM
seb835 seb835 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: UK, London
Posts: 95 seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 36 m 11 sec
Reputation Power: 6
Thanks Vlince...i figured out what you said already...duh! what a stupid mistake! Thanks for all your help anyways.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Why doesnt "Cint" work?


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT