Presentation is loading. Please wait.

Presentation is loading. Please wait.

VBScript. Introduction Visual Basic scripting language is client side scripting language. It is developed by Microsoft VBScript is subset of VB language.

Similar presentations


Presentation on theme: "VBScript. Introduction Visual Basic scripting language is client side scripting language. It is developed by Microsoft VBScript is subset of VB language."— Presentation transcript:

1 VBScript

2 Introduction Visual Basic scripting language is client side scripting language. It is developed by Microsoft VBScript is subset of VB language Like JavaScript it is also run in web Browser But VBScript is only Supported by Internet Explorer

3 Example of VBScript VBScript Hello World! document.write ("Hello World!")

4 Output

5 More Example <html><body> alert('Hello VBScript!') alert('Hello VBScript!') </body></html>

6 Output

7 Using VBScript code The VBScript code can be placed in: – tag in the head – tag in the body – not recommended – External files, linked via tag the head Files usually have.vbs extension ‘ code placed here will not be executed! </script>

8 VBScript Variables dim name dim x x=5 name=“Aman” dim name(3) //Array in VBScript name(0)=“ABC” name(1)=“xyz” name(2)=“pqr”

9 Functions in VBScript Function myfunction() some statements End Function

10 Conditional Statements If i < 10 Then response.write("Good morning!") Else response.write("Have a nice day!") End If If i = 10 Then response.write("Just started...!") ElseIf i = 11 Then response.write("Hungry!") ElseIf i = 12 Then response.write("lunch-time!") ElseIf i = 16 Then response.write("Time to go home!") Else response.write("Unknown") End If

11 Conditional Statements d=weekday(date) Select Case d Case 1 response.write("Sleepy Sunday") Case 2 response.write("Monday again!") Case 3 response.write("Just Tuesday!") Case 4 response.write("Wednesday!") Case 5 response.write("Thursday...") Case 6 response.write("Finally Friday!") Case else response.write("Super Saturday!!!!") End Select

12 For Loop in VBScript For i = 0 To 5 response.write("The number is " & i &" ") Next Output The number is 0 The number is 1 The number is 2 The number is 3 The number is 4 The number is 5

13 Form Processing in VBScript VBScript Demo function calcSum() dim value1, value2, sum value1=(document.myForm.textBox1.value) value2=(document.myForm.textBox2.value) sum = value1 + value2 document.myForm.textSum.value=sum end function

14 Form Processing in VBScript 1st Number: 2nd Number: <input type="button" value=“Calculate" onclick="vbscript:calcSum()" />

15 Output


Download ppt "VBScript. Introduction Visual Basic scripting language is client side scripting language. It is developed by Microsoft VBScript is subset of VB language."

Similar presentations


Ads by Google