Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's because they drop the stack.

Yes, basic did better than that but you can actually 'goto' into some line in another subroutine in BASIC which can cause all kinds of interesting results (usually not the ones you intended though).



You can do the same with longjmp in C. You jump onto an empty stack, so you only have global variables to work with. It's fascinating, but not recommended :)


I'm sure this is all BASIC dependent. MS qBasic has local variables, see:

Look at the documentation for the "shared" statement: http://www.leinweb.com/basic/manual/

It's a pretty nice language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: