Anuncios

Hay un post en español sobre este tema, haz click aqui.

Anuncios

Welcome to this post, we’ll talk about data types that VBscript manages internally. This can be used as reference:

Anuncios
  • Byte, this stores a byte (a number between 0 and 255)
  • Integer, integer numbers of 2 bytes length signed, this allows numbers in the range from -32768 to 32767
  • Long, integer numbers of 2 bytes length signed, this allows numbers in the range from -2147483648 to 2147483647
  • Single, it’s a floating point numbers and simple precision of 4 bytes, its range is from -3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values
  • Double, it’s a floating point numbers and double precision of 8 bytes, its range is from 1.79769313486232E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values
  • Currency, integer on an 8-byte scale, it was designed to avoid the problems that existed with the change between binary and decimal fractions, it can have 4 digits to the right of the decimal point and up to 14 to the left, it is usually used for financial calculations with large numbers and it is as slow as a double precision one, its range goes from -922337203685477.5808 to 922337203685477.5807, it was implemented from version 3
  • Decimal, they’re numbers of 14 bytes that contain big decimal numbers. Its range is from +/-79228162514264337593543950335 without decimal point and to the +/- 7,9228162514264337593543950335 with 28 places to the right of the decimal sign
  • Date, it’s used to store dates, it has a size of 8 bytes and it goes from january, 1st of year 100 to december, 31st of year 9999
  • String, it can hold text string of any length but its range is from 0 to 2 billions if memory allows it, its size in memory is of 10 bytes plus string length
  • Boolean, it holds two values (true or false). We can assign numeric values where 0 is false and other values are true. Usually is assigned as -1 for true
  • Empty, it’s the initial value of any variable
  • Null, it means that has no value but it’s not empty like above type. It must be assigned explicitly in the code: myVar = null
  • Object, it references to a HTML Object, Applet or ActiveX control
  • Nothing, it’s used to free an object from its reference. It must be assigned explicitly: set myObj = nothing
  • Error, it stores error numbers generated by VBscript
Anuncios

These are the data types used by VBscript in variant. We can’t control it but it’s good idea know about this when we assign a value to a variable or we use an object.

Anuncios

In summary, we saw the data types, its name, a description and some references, I hope you’ve found it useful. You can follow me on this social networks:

Anuncios

Donation

It’s for maintenance of the site, thanks!

$1.50