Last modified 4 years ago Last modified on 08/24/08 13:13:04

Local variables belong either to a function or event where they were declared and are not accessible from the outside of it, thus their name: local. Local variables must be declared at the beginning of the function or event. Like public/private variables local variables of the same type can be declared on the same line separated by a comma.

Declaration of a local variable looks as follows:

local <variable type> <variable name> [, <variablename>, ...];

Examples:

event myEvent(myTrigger) {

local int count; &lt;code&gt;

}

function void myFunction() {

local DROID myDroid1, myDroid2; local string myString; &lt;code&gt;

}

{{Scripting manual}} Category:Scripting manual ?