BSL:Functions: Difference between revisions

m
Lukas/Loser tips
m (+cat)
m (Lukas/Loser tips)
Line 6: Line 6:
==Declaration==
==Declaration==
Put usage of <tt>func</tt> here.
Put usage of <tt>func</tt> here.
: [...]
* Tips:
** If you call a second function from inside another function, the second function will be executed til its end and then the rest of the first function gets executed.
** You can call a function recursively, but only up to about four times, then the script execution stucks for some reason (maybe intentional to prevent endless loops?).
==Multithreading==
==Multithreading==
Put usage of <tt>fork</tt> here.
Put usage of <tt>fork</tt> here.
: [...]
* Tips:
** Use "fork" in conjunction with "sleep" to ensure that there is always only one running copy of the function. (Themselves looping functions without sleep can crash the game.)
** And remember to design the code so it cannot create two copies of the function running in parallel. When that happens, the desired loop effect is usually broken and "echos" start to apprear.
==Native functions==
==Native functions==
;I DELETED THE VARIABLES FROM THE LIST AND PUT THEM [[BSL:Variables|HERE]]
;I DELETED THE VARIABLES FROM THE LIST AND PUT THEM [[BSL:Variables|HERE]]
8,018

edits