Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Determine type of Value

Reply
Thread Tools

Determine type of Value

 
 
Shahid Juma
Guest
Posts: n/a
 
      09-29-2004
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


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-29-2004
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.


 
Reply With Quote
 
 
 
 
Shahid Juma
Guest
Posts: n/a
 
      09-29-2004
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]" <> wrote in message
news:%...
> 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.
>
>



 
Reply With Quote
 
Mark Schupp
Guest
Posts: n/a
 
      09-29-2004
http://msdn.microsoft.com/library/de.../mdprotype.asp

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


"Shahid Juma" <> wrote in message
news:...
> 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]" <> wrote in message
> news:%...
> > 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.
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"raise (type, value, traceback)" and "raise type, value, traceback" Jack Bates Python 0 05-02-2011 05:23 PM
Determine type of a variable whose value is NULL brian.vanheesch@gmail.com Java 3 09-15-2007 07:23 PM
compiler error: argument of type "VALUE *" is incompatible with parameter of type "VALUE" me2faster@excite.com Ruby 1 05-05-2005 11:23 PM
how to determine type-type? Gernot Frisch C++ 3 01-13-2005 07:34 AM
nuby: determine method passed and determine the receiver that received the method Peņa, Botp Ruby 1 01-24-2004 07:51 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57