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

Functions

Anonymous

public function foo takes nothing returns nothing
    call TimerStart(CreateTimer(), 5.00, true, function
        call BJDebugMsg("I'm and anonymous function!")
    endfunction)
endfunction

No parameters

public function foo returns nothing
    // ...
endfunction

No return

public function foo takes integer i
    // ...
endfunction

No nothing!

public function foo
    // ...
endfunction

Auto sorting

Functions are going to be sorted automatically depending on the usage, so:

function foo ...
    // ...
endfunction

function bar
    call foo()
endfunction

Is going to be translated to

function bar
    call foo()
endfunction

function foo ...
    // ...
endfunction

It also works for mutual recursion.

Clone this wiki locally