locals globals

BlitzPlus Forums/BlitzPlus Programming/locals globals

Who was John Galt?(Posted 2004) [#1]
If I define a variable as global, then define a local variable of the same name in a function (specifically with the local keyword) will the local version be used in the function?


REDi(Posted 2004) [#2]
Try it...

Global test=100

Print test
Print TestFunction()
Print test

Function TestFunction()

	Local test = 200
	Return test

End Function

Repeat
Until KeyDown(1)



Hope this helps!


Who was John Galt?(Posted 2004) [#3]
Thanks Cliff - and sorry I was so lazy!