Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Print Variable Data Type

Reply
Thread Tools

Print Variable Data Type

 
 
Jess
Guest
Posts: n/a
 
      06-15-2006
Is there a way to print a variable's data type - like int, string, dbl?
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      06-15-2006
=?Utf-8?B?SmVzcw==?= wrote on 15 jun 2006 in
microsoft.public.inetserver.asp.general:

> Is there a way to print a variable's data type - like int, string, dbl?



<script language='javascript' runat='server'>

var myVarable = 2

response.write(typeof myVarable);

</script>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      06-15-2006
Evertjan. wrote on 15 jun 2006 in microsoft.public.inetserver.asp.general:

> =?Utf-8?B?SmVzcw==?= wrote on 15 jun 2006 in
> microsoft.public.inetserver.asp.general:
>
>> Is there a way to print a variable's data type - like int, string, dbl?

>
>
> <script language='javascript' runat='server'>
>
> var myVarable = 2
>
> response.write(typeof myVarable);
>
> </script>
>


And, not teasing you any more, vbscript has:

Dim ArrayVar(4), MyType
NullVar = Null ' Assign Null value.

MyType = TypeName("VBScript") ' Returns "String".
MyType = TypeName(4) ' Returns "Integer".
MyType = TypeName(37.50) ' Returns "Double".
MyType = TypeName(NullVar) ' Returns "Null".
MyType = TypeName(ArrayVar) ' Returns "Variant()".


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
Jess
Guest
Posts: n/a
 
      06-15-2006
COOL! THanks

"Evertjan." wrote:

> Evertjan. wrote on 15 jun 2006 in microsoft.public.inetserver.asp.general:
>
> > =?Utf-8?B?SmVzcw==?= wrote on 15 jun 2006 in
> > microsoft.public.inetserver.asp.general:
> >
> >> Is there a way to print a variable's data type - like int, string, dbl?

> >
> >
> > <script language='javascript' runat='server'>
> >
> > var myVarable = 2
> >
> > response.write(typeof myVarable);
> >
> > </script>
> >

>
> And, not teasing you any more, vbscript has:
>
> Dim ArrayVar(4), MyType
> NullVar = Null ' Assign Null value.
>
> MyType = TypeName("VBScript") ' Returns "String".
> MyType = TypeName(4) ' Returns "Integer".
> MyType = TypeName(37.50) ' Returns "Double".
> MyType = TypeName(NullVar) ' Returns "Null".
> MyType = TypeName(ArrayVar) ' Returns "Variant()".
>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
>

 
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
print a vs print '%s' % a vs print '%f' a David Cournapeau Python 0 12-30-2008 03:19 AM
"Variable variable name" or "variable lvalue" mfglinux Python 11 09-12-2007 03:08 AM
Problem - I want to print Current Output of Pdf file and should print once.I get print dialog box but it is not working keto Java 0 05-30-2007 11:27 AM
Unlarging the print to print using PDF file to print Bun Mui Computer Support 3 09-13-2004 03:15 AM
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. luna ASP .Net 1 02-13-2004 01:15 PM



Advertisments