adsense


Friday, 13 November 2015

ADVANCE VB SCRIPT TYPENAME PAGE 217

COMPUTER LANGUAGES HTML,C,C++.JAVA,.NET AND MULTIMEDIA basics and programs click home button




ADVANCE VB SCRIPT TYPENAME






TypeName 


The TypeName Function is used to return the variant subtype information of the variable. 
Syntax 
TypeName(varname) 
The Typename function can return any of the following values. 

• Byte - Byte Value 

 

• Integer - Integer Value 

 

• Long - Long Integer Value 

 

• Single - Single-precision floating-point Value 

 

• Double - Double-precision floating-point Value 

 

• Currency - Currency Value 

 

• Decimal - Decimal Value 

 

• Date - Date or Time Value 

 

• String - Character string Value 

 

• Boolean - Boolean Value 

 

• Empty - Uninitialized Value 

 

• Null - No Valid Data 

 

• Object - typename of Object 

 

• Nothing - Object variable that doesn't yet refer to an object instance 

 

• Error 

Example 
<!DOCTYPE html> 
<html> 
<body> 
<script language="vbscript" type="text/vbscript"> 
 
  Dim ArrVar(2), vartype 
  NullVar = Null   ' Assign Null value. 
 
  vartype = TypeName(3.1450)      
  Document.write "Line 1 : " &  vartype  & "<br />"  
  vartype = TypeName(432)          
  Document.write "Line 2 : " &  vartype  & "<br />"  
  vartype = TypeName("Microsoft") 
  Document.write "Line 3 : " &  vartype  & "<br />"  
  vartype = TypeName(NullVar)    
  Document.write "Line 4 : " &  vartype  & "<br />"  
  vartype = TypeName(ArrVar)     
  Document.write "Line 5 : " &  vartype  & "<br />" 
 
</script> 
</body> 
</html> 
Save the file with .html extension upon executing the script in IE, 
the following result is displayed on the screen. 
Line 1 : Double 
Line 2 : Integer 
Line 3 : String 
Line 4 : Null 
Line 5 : Variant() 
 


No comments: