Run the routine again and note the current value outputted for x
This shows that the value of 10 assigned to x inside the <script> delimiters is not recognised outside the script.
However, if the intention is simply to produce a client-side routine, then code like this can be placed between <script> tags.
<%Option Explicit%>
<HTML>
<HEAD>
<title> Script-level code></title>
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Private x
x=10
Private Function Increment(IVar)
IVar= IVar + 1
Increment = IVar
End Function
Private Function
Decrement(IVar)
IVar = IVar - 1
Decrement = IVar
End Function
</SCRIPT>
</HEAD>
<BODY>
<H2><CENTER>An Active Server Page</CENTER></H2>
The current value of x is <%=
x %> <BR>
<%
Dim y
y = 20
If x = 0 Then x = 10
%>
Value returned by Increment function: <%=
Increment(x) %> <BR>
Value returned by Increment function: <%=
Increment(x) %> <BR>
Value returned by Decrement function: <%=
Decrement(x) %> <BR>
The value of <I>x</I>
is now <%= x %>.
The value of <I>y</I>
is <%= y %>.
</BODY>
</HTML>