adsense


Thursday, 12 November 2015

ADVANCE VB SCRIPT OPTION EXPLICIT PAGE 211

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




ADVANCE VB SCRIPT OPTION EXPLICIT





Option Explicit 


Option Explicit forces the developer to declare the variables 
using Dim statement before they are used in some part of the code. 
Syntax 
Option Explicit 
Example 
If we use Option Explicit and if we don't declare the variables 
then the interpreter will throw and error. 
<!DOCTYPE html> 
<html> 
<body> 
<script language="vbscript" type="text/vbscript"> 
  
  Option Explicit 
  Dim x,y,z,a 
  x = 10 
  y = 20 
  z = fnadd(x,y) 
  a = fnmultiply(x,y) 
 
  Function fnadd(x,y) 
      fnadd = x+y 
  End Function 
 
</script> 
</body> 
</html> 


No comments: