473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Print Variable Data Type

Is there a way to print a variable's data type - like int, string, dbl?
Jun 15 '06 #1
3 3997
=?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)
Jun 15 '06 #2
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)
Jun 15 '06 #3
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)

Jun 15 '06 #4

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

Similar topics

7
by: Henri Schomäcker | last post by:
Hi folks, I got a windows com executable which returns a jpg image in a BSTR. Let's say, the var that holds the data is $imgData. With perl, in a cgi script, I may simpy write:...
12
by: neutrino | last post by:
Greetings to the Python gurus, I have a binary file and wish to see the "raw" content of it. So I open it in binary mode, and read one byte at a time to a variable, which will be of the string...
23
by: stewart.midwinter | last post by:
No doubt I've overlooked something obvious, but here goes: Let's say I assign a value to a var, e.g.: myPlace = 'right here' myTime = 'right now' Now let's say I want to print out the two...
4
by: Jan | last post by:
I am having problems trying to print a report based on a form. This is a search form only, no data input. There is a query that the form looks at, but then there are numerous comboxes that you...
6
by: HappyHippy | last post by:
More of a minor niggle than anything but how would I remove the aforementioned space? eg. strName = 'World' print 'Hello', strName, ', how are you today?' comes out as "Hello World , how are...
6
by: mirandacascade | last post by:
O/S: Win2K Vsn of Python: 2.4 Here is copy/paste from interactive window of pythonwin: >>> x = "Joe's desk" >>> y = 'Joe\x92s desk' >>> type(x) <type 'str'> >>> type(y)
13
by: katysei | last post by:
I have to print several large structs to print the screen. I was wondering if thers a tool to do so automaticly struct A { int i; char * s; }
3
by: Max58kl | last post by:
Trying to access data and print it to the screen using Perl Builders I/O Window -------------------------------------------------------------------------------- Hi I am using a program called...
2
by: JRough | last post by:
I have this code that switches templates depending on if the user fills in a form with a request. The request asks for the $mark & $number. If that request gets input then it displays a list...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.