Skip to content

Variable initialization

Franco Montenegro edited this page Apr 17, 2016 · 2 revisions

Variable initialization

By default, all variables with no values at all are going to be auto initialized. This is to avoid errors.

So for example

function foo takes nothing returns nothing
    local string str
endfunction

In this case, the variable str is going to be initialized with the value "" (an empty string).

local string  s // -> ""
local unit    u // -> null (works with any handle)
local real    r // -> 0.00
local integer i // -> 0
local boolean b // -> false
Clone this wiki locally