donnerkuh Posted June 24, 2021 Share Posted June 24, 2021 I need help This works: on e gosub szene1 szene2 szene3... This doesn´t work: on e gosub szene1 bank2 szene2 bank2 szene3 bank2... Will i have to put all szene´s into bank1? Or is it possible to jump to another bank and there is a syntax error in my code? Quote Link to comment https://forums.atariage.com/topic/322184-on-gosub-does-not-work-with-bankswitching/ Share on other sites More sharing options...
+KaeruYojimbo Posted June 24, 2021 Share Posted June 24, 2021 On..gosub and on..goto don't work across different banks. One workaround would be to have the on...gosub go to something in the same bank that then uses goto to go to the other bank. So like on e gosub jumpszene1 jumpszene2 jumpszene3... jumpszene1 gosub szene1 bank2 jumpszene2 gosub szene2 bank2 Or put the on...gosub in bank2, something like goto pickszene bank2 . . . pickszene on e gosub szene1 szene2... 2 Quote Link to comment https://forums.atariage.com/topic/322184-on-gosub-does-not-work-with-bankswitching/#findComment-4850309 Share on other sites More sharing options...
donnerkuh Posted June 25, 2021 Author Share Posted June 25, 2021 i will choose the second tip - thanks! Quote Link to comment https://forums.atariage.com/topic/322184-on-gosub-does-not-work-with-bankswitching/#findComment-4850671 Share on other sites More sharing options...
+Gemintronic Posted June 25, 2021 Share Posted June 25, 2021 Also, watch out for putting too many labels in your on .. goto/gosub statements. https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#ongosub I keep the labels under 45 per R.T.s hints in the link. Also, make the labels VERY short just in case the parser doesn't like VERY long single line statements. I don't really know how many characters are allowed, but, yeah. Not the problem you were having BUT it's often the very next to come up 2 Quote Link to comment https://forums.atariage.com/topic/322184-on-gosub-does-not-work-with-bankswitching/#findComment-4850760 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.