Print Variable Data Type

E

Evertjan.

=?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>
 
E

Evertjan.

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:



<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()".
 
J

Jess

COOL! THanks

Evertjan. said:
Evertjan. wrote on 15 jun 2006 in microsoft.public.inetserver.asp.general:


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()".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top