I've been moving parts of my code into functions, and I've recently put a piece of code and the gosubs it calls into a function. Suddenly my code would just end after calling the function, not giving any error, but just ending the program. It was as if the function was not returning to where I'd called it from. After some testing, I found out that this only happened when there were gosub subroutines in the function, regardless of whether I was calling them or not.
Can I not put subroutines in a function, seeing as it is something of a subroutine itself? That would be awful, I think, as I want to eventually export this function to and #include file, and it would be much harder to deal with without subroutines.