Remembering the previous tutorial we were ready to start coding. In fact we revealed what's inside those GUI blocks ans we saw they were just functions. Now it's time to understand the structure and how we should write.
When the code in the map is armed in the *.j file, it will condense the code in this way:
In JASS the function's order is very important in the sense that any function required by another function must be over the caller one. Here's an example:
[btable]Incorrect[c]Correct[r]
to be continued...
When the code in the map is armed in the *.j file, it will condense the code in this way:
//Global section
globals
//here you'll find all the global variables in the map
endglobals
//End of the Global section
//Function section: here you will find all the functions that will manage the map.
//...
function bla1 takes ... returns ...
// here will be a bunch of functions
endfunction
function bla2 takes ... returns ...
// and more functions... :D
endfunction
//... and more functions ... :)
function main takes nothing returns nothing
// Here's the main initial function
endfunctionIn JASS the function's order is very important in the sense that any function required by another function must be over the caller one. Here's an example:
[btable]Incorrect[c]Correct[r]
function Caller takes nothing returns nothing
// some code...
call Called()
// More code...
endfunction
function Called takes nothing returns nothing
// Do some stuff...
endfunction[c]function Called takes nothing returns nothing
// Do some stuff...
endfunction
function Caller takes nothing returns nothing
// some code...
call Called()
// More code...
endfunction[/btable]to be continued...