ASP 101 - Active Server Pages 101 - Web01
The Place ASP Developers Go!

Please visit our partners


Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash





ASP Source Code:
<%
' This is a simple subroutine that takes three
' integer parameters and simply increments each
' by 1.  The only difference is that for the
' first one I don't specify how the parameter
' should be passed, for the second I indicate
' that the parameter should be passed by
' reference (ByRef), and for the third I
' indicate that it should be passed by value 
' (ByVal).
Sub SampleSub(parDefault, ByRef parByRef, ByVal parByVal)
	parDefault = parDefault + 1
	parByRef   = parByRef   + 1
	parByVal   = parByVal   + 1
End Sub
' Declare our variables
Dim intDefault  ' This is the variable that I'll pass
                ' to the parameter that doesn't
                ' specify anything.
Dim intByRef    ' This variable I'll pass ByRef
Dim intByVal    ' This variable I'll pass ByVal
' Set all our variable to the same value.
intDefault = 1
intByRef   = 1
intByVal   = 1
' Display the variable values before:
%>
<p>
<strong>Values Before Calling the Sub:</strong><br />
intDefault = <%= intDefault %><br />
intByRef   = <%= intByRef %><br />
intByVal   = <%= intByVal %>
</p>
<p>
<strong>Now Calling:</strong><br />
SampleSub(intDefault, intByRef, intByVal)
</p>
<%
' Call the sub passing our three variables in
' as parameters.
Call SampleSub(intDefault, intByRef, intByVal)
' Display the variable values after:
%>
<p>
<strong>Values After Calling the Sub:</strong><br />
intDefault = <%= intDefault %><br />
intByRef   = <%= intByRef %><br />
intByVal   = <%= intByVal %>
</p>

Back the the Sample Output

Back to the Sample Index


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers