VBScript/Classic ASP Function Parameters

I know that VBScript passes parameters by reference, but I seldom take advantage of that feature. So when I need it, I am always able to convince myself that I’m misremembering. So here are the results of a recent test to remind me:

function Three(N)
	N = 3
	Three = 0
end function

dim x
x = 1
Response.Write "<p>x = " & x & "; Three(x) = " & Three(x) & "; x = " & x & "</p>" & vbCrLf

Output:

x = 1; Three(x) = 0; x = 3

Leave a Reply

Your email address will not be published. Required fields are marked *