adsense


Showing posts with label ADVANCE VB SCRIPT BYREF PARAMETERS. Show all posts
Showing posts with label ADVANCE VB SCRIPT BYREF PARAMETERS. Show all posts

Sunday, 8 November 2015

ADVANCE VB SCRIPT BYREF PARAMETERS PAGE 94

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




ADVANCE VB SCRIPT BYREF PARAMETERS




VBScript ByRef Parameters 


If ByRef is specified, then the arguments are sent as 
a reference when the function or procedure is called. 
 
Example 
<!DOCTYPE html> 
<html> 
<body> 
<script language="vbscript" type="text/vbscript"> 
 
Function fnadd(ByRef num1, ByRef num2) 
   num1 = 4 
   num2 = 5 
End Function 
  
 Dim x,y 
 x=6 
 y=4 
 res= fnadd(x,y) 
 document.write("The value of x is " & x & "<br />") 
 document.write("The value of y is " & y & "<br />") 
  
</script> 
</body> 
</html> 
The above function takes the parameter x and y as by reference. 
Hence, after executing the function, the values are changed. 
If the above function is saved as .html and executed in IE, 
the output would be as follows: 
The value of x is 4 
The value of y is 5