|
<SCRIPT LANGUAGE="VBScript">
Option Explicit
Dim x
x = 10
Function Increment(lVar)
lVar = lVar + 1
Increment = lVar
End Function
Function Decrement(lVar)
lVar = lVar - 1
Decrement = lVar
End Function
</SCRIPT>
<CENTER><H2>Welcome to our web page!</H2></CENTER>
<SCRIPT LANGUAGE="VBScript">
Document.Write "The current value of x is " & x & "<BR>"
Dim y
y = 20
If x = 0 Then
Document.Write "Initializing <I>x</I> in the second script block" & "<BR>"
x = 10
End If
Document.Write "Value returned by Increment: " & Increment(x) & "<BR>"
Document.Write "Value returned by Increment: " & Increment(x) & "<BR>"
Document.Write "Value returned by Decrement: " & Decrement(x) & "<BR>"
Document.Write "The value of x is now " & x & "<BR>"
Document.Write "The value of y is " & y & "<BR>"
</SCRIPT>
|
|