Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
com
Visit:
www.gcreddy.com
------------------------------------------------VB Script Data Types
What is Data Type?
Data type is a categorization of identifying one of various types of data, such as string, integer, double, date or Boolean etc
www.gcreddy.com
www.gcreddy.com
X=#10/10/2010# Date
It consists of any type of characters, maximum length up to approximately 2 billion characters. Boolean:
www.gcreddy.com
www.gcreddy.com
It Contains either True or False (Logical Result) Empty: Uninitialized, Value is 0 for numeric variables or a zero-length string ("") for string variables. Integer: Contains integer in the range -32,768 to 32,767 Long Integer Contains integer in the range -2,147,483,648 to 2,147,483,647 Double: Contains a double-precision, floating-point number in the range -1.79769313486232E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values. Date: Contains a number that represents a date between January 1, 100 to December 31, 9999 Object: Contains an object Error: Contains an error number Null: Contains no valid data Etc ------------------------------------------------------------------------------------
www.gcreddy.com
www.gcreddy.com
x=Cint(x) Msgbox VarType(x) '2 for Integer y=InputBox("Enter a Value") Msgbox VarType(y) '8 for String y=Cdbl(y) Msgbox VarType(y) '5 for double 'Read from Application Objects Tickets = Window("Flight Reservation").WinEdit("Tickets:").GetVisibleText() Msgbox VarType(Tickets)'8 Tickets=Cint(Tickets) Msgbox VarType(Tickets) '2 Price = Window("Flight Reservation").WinEdit("Price:").GetVisibleText() Msgbox VarType(Price) '8 Price=Cdbl(Price) Msgbox VarType(Price) '5 ---------------------------------------------------------------------Example: 2 Dim a, b, c a=100 Msgbox VarType(a) 8 for String a=Cint(a) Msgbox VarType(a) 2 for Integer b=100.345 Msgbox VarType(b) 8 for String b=Cdbl(b) Msgbox VarType(b) 5 for Double c=Hyderabad Msgbox VarType(c) 8 for String c=Cint(c) Msgbox VarType(c) Mismatch (Error) Note: we cant convert alphabets as integer or double type data Thanks G C Reddy
www.gcreddy.com