473,624 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Determine type of Value

Hello All,

This may be a trivial question, but I was wondering how can you determine if
a value contains an Integer or Float. I know there is a function called
IsNumeric, however you can't determine what type it is.

Thanks for the help,
Shahid
Jul 19 '05 #1
3 2580
Shahid Juma wrote:
Hello All,

This may be a trivial question, but I was wondering how can you
determine if a value contains an Integer or Float. I know there is a
function called IsNumeric, however you can't determine what type it
is.

Thanks for the help,
Shahid


If Int(val) = val then
'It's an integer
Else
'It's a float
End if

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #2
Thanks,

A follow up to this question. How can you determine what type of variable it
is from the record set. If you have a query that looks at a table in SQL
Server. How can you tell that a certain field is varchar, bigint, int, etc?
The reason for asking is that I need to know what type of variable it is and
sometimes these fields are empty so using the value to determine what type
won't work every time.

Thanks,
Shahid

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Shahid Juma wrote:
Hello All,

This may be a trivial question, but I was wondering how can you
determine if a value contains an Integer or Float. I know there is a
function called IsNumeric, however you can't determine what type it
is.

Thanks for the help,
Shahid


If Int(val) = val then
'It's an integer
Else
'It's a float
End if

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #3
http://msdn.microsoft.com/library/de.../mdprotype.asp

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Shahid Juma" <sh************ *****@hotmail.c om> wrote in message
news:un******** ******@TK2MSFTN GP10.phx.gbl...
Thanks,

A follow up to this question. How can you determine what type of variable it is from the record set. If you have a query that looks at a table in SQL
Server. How can you tell that a certain field is varchar, bigint, int, etc? The reason for asking is that I need to know what type of variable it is and sometimes these fields are empty so using the value to determine what type
won't work every time.

Thanks,
Shahid

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Shahid Juma wrote:
Hello All,

This may be a trivial question, but I was wondering how can you
determine if a value contains an Integer or Float. I know there is a
function called IsNumeric, however you can't determine what type it
is.

Thanks for the help,
Shahid


If Int(val) = val then
'It's an integer
Else
'It's a float
End if

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
6134
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number. "Decimal Number" sometimes serves to distinguish Base 10 numbers, eg "15", from Base 2 numbers, Eg "1111". At other times "Decimal Number" serves to differentiate a number from an integer. For the rest of this post I shall only use either...
2
2175
by: bart plessers | last post by:
Hello, I have a form with some checkboxes, i.e. The default value of this checkbox is determined in a global file (config.asp), that is included in first line of the form, i.e. ShowFilenames = 1 The first time the form is displayed, the value of ShowFilenames should be
18
2876
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code that applies to all these events, but I need to have specific code execute when the form closes. The properties for this method are sender (the originator) and e (event arguments). I know how to get typeof (sender) to determine what form or...
3
2076
by: JK | last post by:
This is an easy one, but I'm a JS newbie. I want to write a function that determines input value. If 0 - 100 than will use input as % (i.e., 3 would become .03 and used for calculations); otherwise, as dollar value (i.e., 1,000 would become $1,000 and used for calculations). In other words, I want input.value 3 to either be input.value 1 * input.value 2, or simply = input.value 1. Please be specific about placement of function (header or...
3
7481
by: Bob Day | last post by:
VS 2003, sql How do you determine the data type of a column if its value is DBNull? 1)Table: Column1 STRING non-nullable 2) Fill to a DataSet via DataAdapter 3) dim Data_Type_Is as object
16
3411
by: Jm | last post by:
Hi All Is it possible to determine who is logged onto a machine from inside a service using code in vb.net ? I have found some code that seems to work under vb6, but doesnt under .NET ? Any help is greatly appreciated Thanks
14
2198
by: Joseph Turian | last post by:
How can I determine the type of some particular typename? I am writing a template, and it needs special case handling for some particular types: template <typename T> class foo { public: foo() { if (T == int) cerr << "int\n";
1
1560
by: tshad | last post by:
I have some code to go through a session collection for my error page routine and I get an error on my objects that I store in session variables. Dim strName as String Dim iLoop as Integer For Each strName in Session.Contents trace.warn(strName & " - " & Session.Contents(strName)) Next
5
4012
by: mantrid | last post by:
Hello Im trying to find the correct syntax to use to determine whether which form element is visible on changing the value in a dropdown list I need something in the onChange of the dropdown list that will cause the appropriate element on another part of the page to be displayed pseudo code below var mydropdownlist =
0
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8619
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8334
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.