Game Development Community

Console language variables assignment by reference?

by Denis Haineault · in Technical Issues · 11/13/2003 (10:23 am) · 2 replies

Hi,

I've very recently picked up the engine and had a question about the Language Reference section (in the SDK doc). The part about "Variables" show something like this:

$someGlobal = "This is some global.";

function foo(%local1, %local2)
{
	%local3 = $someGlobal;
}

Using this example, I'm just curious how the engine performs assignment here...if I assign a new value to %local3 (after the %local3 = $someGlobal; line), does this change $someGlobal? In other words (like the subject says) are variable assginments done by reference, or are they copies? And does this (what ever your answer is) apply for all types of assignments (i.e. strings, numbers, other objects, etc...)

thanks

#1
11/13/2003 (10:38 am)
No it does not change $someGlobal
#2
11/13/2003 (11:04 am)
No any assignment in the script is Not a reference.

a couple simple test's would prove this one way or the other.