13 years
edited 13 years
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:
1 //Global section2 globals3 4 //here you'll find all the global variables in the map5 6 endglobals7 //End of the Global section8 9 //Function section: here you will find all the functions that will manage the map.10 //...11 12 function bla1 takes ... returns ...
13 // here will be a bunch of functions14 endfunction15 16 function bla2 takes ... returns ...
17 // and more functions... :D18 endfunction19 20 //... and more functions ... 
21 22 function main takes nothing returns nothing
23 // Here's the main initial function24 endfunction
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]
1 function Caller takes nothing returns nothing
2 // some code...3 call Called()
4 // More code...5 endfunction6 7 function Called takes nothing returns nothing
8 // Do some stuff...9 endfunction
[c] 1 function Called takes nothing returns nothing
2 // Do some stuff...3 endfunction4 5 function Caller takes nothing returns nothing
6 // some code...7 call Called()
8 // More code...9 endfunction
[/btable]to be continued...