Code: Select all
Function test()
test2()
DebugPrint("test11")
Function test2()
DebugPrint("test2")
EndFunction
EndFunction
Which gives me two questions, one which is half a wish.
1. Would it be difficult to add possibility for nested functions? Nested functions that would only work inside the function they were declared in could help human readability of the codel
For naming small parts of code into their own functions would make it much easier to figure out what code is doing, however, doing loads of small functions will make it very hard to find anything if you need to keep hunting those functions all around, especially when they are used only inside one function only.
example:
Code: Select all
Function MoveEnemies()
listofenemiestomove = CheckEnemiesThatAreGoingToMove(level.enemiestable)
MoveEnemies(listofenemiestomove)
CheckIfEnemiesThatMovedShoot(listofenemiestomove)
function Listofenemiestomove(allenemies)
for n = 1 to tableitems(allenemies)
check lots of things
next
endfunction
functionMoveEnemies(listofenemiestomove)
for n = 1 to tableitems(listofenemiestomove)
check lots of things
next
endfunction
function CheckIfEnemiesThatMovedShoot(listofenemiesthatmoved)
for n = 1 to tableitems(listofenemiesthatmoved)
checklotofthing
next
EndFunction
EndFunction
For this the nested functions would be great, and in the order that I can put the code first and functions after the code part, since otherwise if i keep jumping to functions in IDE, then I need to scroll down first to see the code first, which would be annoying.
2. As I mentioned, it didnt give any error, which I found odd, how so?