Variables Declared in a Function are Local to that Function

Below is the result of a program which shows how scope (local versus global variables) works. Follow that code and see what it is doing....

The Code:

<script type="text/vbscript">
dim name, dummy
name = "Frank"
	document.write(name)
	
dummy=someFunction
	
	document.write(name)
    
	function someFunction()
	
	dim name
	
name="Richard"

	document.write(name)	

	end function
//-->
</script>