adsense


Friday, 6 November 2015

VB SCRIPT WHILE WEND LOOP PAGE 16

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




VB SCRIPT WHILE WEND LOOP





While...Wend Loop 


In a While..Wend loop, if the condition is True, all statements are executed untilWend keyword is encountered. 
If the condition is false, the loop is exited and the control jumps to very next statement after Wend keyword. 
Syntax 
The syntax of a While..Wend loop in VBScript is: 
While condition(s) 
   [statements 1] 
   [statements 2] 
   ... 
   [statements n] 
Wend 
 
 
Example 
<!DOCTYPE html> 
<html> 
<body> 
<script language="vbscript" type="text/vbscript"> 
   
  Dim Counter :  Counter = 10    
  While Counter < 15     ' Test value of Counter. 
    Counter = Counter + 1   ' Increment Counter. 
    document.write("The Current Value of the Counter is : " & Counter) 
 document.write("<br></br>") 
  Wend   ' While loop exits if Counter Value becomes 15. 
    
</script> 
</body> 
</html> 
When the above code is executed, it prints the following output on the console. 
The Current Value of the Counter is : 11  
 
The Current Value of the Counter is : 12  
 
The Current Value of the Counter is : 13  
 
The Current Value of the Counter is : 14  
 
The Current Value of the Counter is : 15 


No comments: